Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Debug.waitForDebugger(); not working in Android studio

When I worked with Eclipse, I used Debug.waitForDebugger() to enter debug mode in hard to reach classes like services.

However, since I moved to Android Studio, I was not able to get Debug.waitForDebugger() to work. When I add it and run the app, it does not enter debug mode at all.

Does anyone know how to make Debug.waitForDebugger() work in Android Studio?

like image 224
dors Avatar asked Aug 01 '26 03:08

dors


1 Answers

Quoting from AOSP issue 76040 https://code.google.com/p/android/issues/detail?id=76040 -

"DDMS in Eclipse will monitor apps run on a device. When apps show up in ddms in "waiting-for-debugger" mode and the app name (its package) match the package of an app opened in the workspace, then ADT will automatically connect the debugger configured with that particular app.

We should do this in Studio as well. Probably after 1.0 though"

Up until today this problem has not been resolve yet in Android Studio.

like image 73
Nati Dykstein Avatar answered Aug 02 '26 19:08

Nati Dykstein



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!