Debugging of my app is now suddenly broken. It has been fine up to now and I even reloaded a known good version of my entire code and it still fails to debug or even run.
I know this is kind of late.... use it if @Sam's or @Killesk's answers do not work.
ensure the manifest sets android:debuggable.
In onCreate
, add a call to Debug.waitForDebugger.
Adding the call to waitForDebugger
also works when reversing. For example you can add the following by hand in onCreate
and have smali/baksmali recompile it:
invoke-static {}, Landroid/os/Debug;->waitForDebugger()V
I don't have to use the tricks often, but when I do, waitForDebugger
always works. I don't recall a time I could not snap the debugger with it.