How to Debug Application over WiFi on Android Device


Start off by connecting both your Android device and your PC to a WiFI access point. Now open the Android terminal application and run netcfg to find out the ip address that was assigned to your Android device.

*** Android on-device console ***

You should now be able to ping your Android device. Replace x.x.x.x with the actual ip address of your Android device:

*** PC console ***
ping x.x.x.x

Now activate “ADB over Network”. Cyanogenmod offers a developer friendly checkbox to let you do this. On a stock Android system you can do the same, by invoking the following commands:

*** Android on-device console ***
setprop service.adb.tcp.port 5555
stop adbd && start adbd

(Yes, it can be rather inconvenient to enter this on a mobile device. Please make sure to read “Creating Android script files” further below. Good news is: you will not need to use your on-device terminal again.)

In order to ADB connect over WiFi, run the following command. Always replace x.x.x.x with the actual ip address of your Android device:

*** PC console ***
adb connect x.x.x.x

Please make sure to activate “Keep Wi-Fi on during sleep” (under Wi-Fi / Advanced). :D

eclipse debugger stops at DexFile.defineClass


It is simply a breakpoint being set at the class-definition level (i.e. a breakpoint set in Eclipse on the line “public class MyActivity…” :wink:

May be android emulator handles this kind of breakpoint by DexFile.defineClass. :roll: