Android Wireless Debugging

Category: 

Normally you connect your Android device via an USB-Cable to your PC and use the Android Debug Bridge (adb) for debugging. But you don't need the cable! Adb is able to connect to your phone via wifi.

Prerequisites

You should be able to debug your Android device via an USB-Cable. If you are using an old device (Android 2.3 or lower), you need root-access on your device. This is not necessary on newer versions of Android.
To start wireless debugging, you can use a simple tool I wrote or you can configure everything via terminal.

Wearable devices, like Smartwatches, are often missing a WLAN module. On those devices, it is not possible to debug wireless with adb.

WiFiDebugging App

I wrote a small program to easily establish the wireless link to my smartphone: Download
If you start the program for the first time, you need to set the path to your Android Debug Bridge.

Click on "..." and search for your Android SDK folder. The adb lies inside the platform-tools folder. After that, click on OK and the program is ready for work.

The tool shows all connected devices width their ID and name. If you (dis-)connect a device, you should click on refresh to update the list of devices.
You can click on each device and switch between USB and WiFi mode.

Via Terminal

If you don't want to use my tool, you can activate the wireless debugging via the terminal. First of all connect your phone and start a terminal.
Now we need to tell our device on which port it should listen:
adb tcpip 5555
//if multiple devices are connected:
adb -s <DeviceID> tcpip 5555
//Example: adb -s 12345678abcd1234 tcpip 5555

To get the ID we list all connected devices and search for the correct one:
adb devices -l

Next we need the lan ip-address of the device. If you don't know the address, you could look in the settings:
Settings => About Phone => Status => IP-Address
The lan address often looks like that: 192.168.0.x
Now we enter the following command:

adb connect <ip>
//example: adb connect 192.168.0.10

If no error occurs, you can pull the cable and debug without it.
When you're finished with wireless debugging, you can switch it off with:

adb usb
//if there are more than one device:
adb -s <DeviceID> usb
//example: adb -s 192.168.0.10:5555 usb