I normally debug my apps by pressing the little "bug" icon in Eclipse.
But now I have inserted an intent filter like this in my manifest:
<action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" />
While the app launches now automatically when the USB cable is plugged in - I cannot debug it anymore. There is no stop at any breakpoint anymore.
How would I debug the app when launched through an intent?
Many thanks!
I ran into this problem and I resolved it with the code below. The code is based on the prior answers. (Thanks for the ideas!)
Wait too long and it will ANR!
I have a Nexus 6P, and in my Developer options there's a "Wait for debugger" toggle. That worked for me. You also have to choose your app as the app to debug. "Select debug app". And of course you have to have installed the debuggable version of your app. Just do a debug launch in Eclipse or Android Studio.
The solution is like this, put a delay in the app when it starts due to the intent filter launch. Then run to the debug window as long as the app is visible there, attach the app process and viola you may debug the app like before