Debug.waitForDebugger (); doesn't work in android studio

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

However, since I switched to Android Studio, I was unable to get Debug.waitForDebugger () to work. When I add it and run the application, it doesn't enter debug mode at all.

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

+3


source to share


2 answers


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

"DDMS in Eclipse will keep track of applications running on the device. When applications are displayed in ddms standby mode for the debugger and the application name (its package) matches the application package open in the workspace, then ADT will automatically attach the debugger configured for that specific applications.



We have to do this in Studio too. Probably after 1.0 though "

Until today, this issue has not yet been resolved in Android Studio.

+2


source


try it android.os.Debug.waitForDebugger();



0


source







All Articles