Skip to content

Instantly share code, notes, and snippets.

@asad-albadi
Created September 10, 2023 04:54
Show Gist options
  • Save asad-albadi/bef62435c2e6dec6200b3cab82353e2e to your computer and use it in GitHub Desktop.
Save asad-albadi/bef62435c2e6dec6200b3cab82353e2e to your computer and use it in GitHub Desktop.
Wireless Debugging Setup Guide using ADB

Wireless Debugging Setup Guide using ADB

Introduction

Wireless debugging allows you to run Android debugging commands and deploy apps to your device over a Wi-Fi network without the need for a USB cable. This guide will walk you through the setup process.

Prerequisites

  • An Android device
  • A computer with ADB installed
  • Both your computer and Android device connected to the same Wi-Fi network

Steps

  1. Connect Android Device via USB

    Connect your Android device to your computer using a USB cable to initiate the wireless debugging setup.

  2. Enable Developer Options

    • On your Android device, open the "Settings" app.
    • Scroll down and select "About Phone" or "About Device."
    • Find and tap on "Build Number" multiple times (usually 7) until you see a message saying you are now a developer.
  3. Enable USB Debugging

    • Go back to the main "Settings" menu.
    • Scroll down and select "Developer Options" or "System" -> "Developer options."
    • Toggle on the "USB Debugging" option. You may need to confirm your device's PIN or pattern.
  4. Connect to Wi-Fi

    • Ensure that both your computer and Android device are connected to the same Wi-Fi network.
  5. Open a Terminal or Command Prompt

    On your computer, open a terminal or command prompt window. You will use this to issue ADB commands.

  6. Check Connected Devices

    • Run the following command to verify that your device is connected via USB:
      adb devices
      
      Your connected device should be listed.
  7. Enable Wireless Debugging

    • Run the following command to restart ADB in TCP/IP mode:
      adb tcpip 5555
      
  8. Find Android Device's IP Address

    • You can find your Android device's IP address through various methods:
      • Go to "Settings" -> "About Phone" -> "Status" -> "IP address."
      • Check the Wi-Fi network settings on your device.
      • Run adb shell netcfg and look for your device's IP address.
  9. Disconnect USB Cable

    Safely disconnect the USB cable from your Android device.

  10. Connect to Android Device Over Wi-Fi

    • Run the following command to connect to your Android device using its IP address:
      adb connect [your_device_ip]:5555
      
      Replace [your_device_ip] with the IP address from step 8.
  11. Verify Connection

    • Run the command adb devices again. You should see your device listed with a status of "device."
  12. Wireless Debugging Ready

    Your Android device is now connected for wireless debugging. You can run ADB commands, deploy apps, and perform debugging tasks without a USB cable.

  13. Optional: Reverting to USB Debugging

    To switch back to USB debugging, simply connect your device via USB and run adb usb to reset the connection.

Conclusion

You have successfully set up wireless debugging for your Android device using ADB. This enables you to perform debugging tasks over a Wi-Fi network, providing flexibility and convenience for app development and testing.

Additional Information

Here are the commands you used in this guide:

# Check connected devices
adb devices

# Restart ADB in TCP/IP mode on port 5555
adb tcpip 5555

# Connect to your Android device over Wi-Fi using its IP address
adb connect [your_device_ip]:5555
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment