Debugging an Android Thread / Service

Trying to debug an Android application recently, Eclipse wasn’t stopping on my breakpoints following an asynchronous / threaded API call.

This single line of code solved my problem:

android.os.Debug.waitForDebugger();

This will cause the Android Debugger to attach even after launching the application normally.

Hope this helps!


About this entry