When developing android applications I sometimes run out of usb ports on my notebook and have no free ports left to connect my nexus device. Luckily a friend of mine showed me a neat little trick to run ADB (Android Debug Bridge) using TCP/IP over Wifi. This means that you don’t have to tether your Android device to your computer when you are developing.
This allows to quickly charge up a device using wall-mounted usb charger while still being able to develop your program and push new builds to the device as long as it is connected to the same wireless network. I guess in a project where multiple developers are working on the same project at the same time, multiple computers can connect to the same android device via tcp/ip and push out new builds to the device simultaneously. (Only prerequisite being that all computers must use the same debug key to code sign the build).
Follow these steps to connect your android device using ADB over TCP/IP:
Connect your Android device to your computer and make sure that you have USB Debugging enabled (Settings –> Developer options –> USB debugging)
Fire up your favourite Terminal/Console application. In case you didn’t add the SDK folder to your PATH system variable. Navigate to your directory.
Make sure ADB can see your device via usb:
[bash]$ adb devices
List of devices attached
02ccbd8c093efac2 device
[/bash]
Restart ADB in TCP/IP mode with the following command: (5555 represents the port used for the adb onnection – can be changed to your liking)
[bash]$ adb tcpip 5555
restarting in TCP mode port: 5555
[/bash]
ADB will promptly respond that it has restarted ADB in TCP/IP mode. Now you need to connect adb to your phone using the phone’s ip address (Settings –> About phone –> Status –> IP address)
[bash]$ adb connect 10.1.1.161 #replace 10.1.1.161 with your phone’s ip address
connected to 10.1.1.161:5555[/bash]
again listing all your connected devices with
[bash]$ adb devices
List of devices attached
10.1.1.161:5555 device[/bash]
should now list your phone’s ip address and you can install and push new builds directly from eclipse to your phone via WiFi
