Debugging an App that does not have a launcher Activity

575 views Asked by At

My current application does not have any activities. It is basically a bunch of services android components without an activity launcher (just like the title says). Basically it gets self triggered with broadcast receivers from the Android OS.

I'm having a hard time attaching my debugger to my android process to debug the App.

Any idea how to force the debugger to attach to the app?

2

There are 2 answers

3
Edson Menegatti On BEST ANSWER

You can use the Debug.waitingForDebugger() utility method for that.

From the documentation:

Wait until a debugger attaches. As soon as the debugger attaches, this returns, so you will need to place a breakpoint after the waitForDebugger() call if you want to start tracing immediately.

0
Red M On

Found the culprit. Adding to what @Edson suggested, I forgot to set the debuggable true on my build types, because it is set to false by default. Now it's working !