Android Remote Debugging with ADB
I fell over a little Android developer tidbit that I thought was cool. Until now I was always debugging my Android apps with ADB over USB, but it turns out that ADB has built in remote debugging via TCP.
This question on StackOverflow has more details:
- You can either root your phone and download something like adbWireless
- Or you can connect the device via USB and enable TCP.
Since I use my personal phone for development and I have some apps that are not happy with rooting, I wanted to go with the USB enabler solution, but I didn’t want to put in the IP all the time. This little batch file does that little extra step for you.
The adbWifi.bat file has to be next to adb.exe in \android-sdk\platform-tools or platform-tools need to be in path or you can use the AndroidSDK environment variable.
To enable TCP:
- Connect your device to USB
- Execute adbWifi.bat
- Disconnect your device from USB