Debug Android App When It Starts On Device
I have an android app that is opened by a URL on my website. What I am looking to do is, attach Eclipse in debug mode when the app starts. I can start the app in debug mode from
Solution 1:
Add a call to android.os.Debug.waitforDebugger()
on the onCreate
of your launch activity. This will make you app wait for a debug to attach whenever it is launched.
Solution 2:
If you look in detail, there's a moment when Eclipse tries to couple the runtime session with the debugger so it starts listening to it until the coupling is made. I guess you'll need to trigger that whenever you open your app.
My question would be, why do you need that? Which are the different conditions when you start the app from the web that make it necessary to debug from there? If there are some, is there any possibility to fake them with any constants or db data?
Post a Comment for "Debug Android App When It Starts On Device"