user387184 user387184 - 1 year ago 81
Android Question

debugging app when launched by intent filter

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!

Answer Source

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download