How to force Eclipse to restart an app that has not changed
Is there a way to force Eclipse to restart an Android app that has not changed, even if it has to be re-downloaded and reinstalled?
I am in a situation where I'm running an Android app that does stuff on startup that I need to repeat for debugging purposes.
What I would like to do is click the "Run" button in Eclipse and hav开发者_开发百科e it force restart my app each time. But instead, Eclipse/Android tries to be smart and it just brings my app to the front without restarting. I get a message in the console:
ActivityManager: Warning: Activity not started, its current task has been brought to the front
The only workaround I have found is to make dummy text changes to force a recompile/re-install. But that's kind of annoying, especially with the code under revision control.
The lazy work is to put a space char , save it, delete the char, save it and rebuild. As i said the lazy (fast) work..
Besides already mentioned meaningless chars and stopping from device menu, you can also stop your application process from DDMS perspective, Devices View -> Name of your process -> push red button.
Kill the app from the running tasks either on the emulator or on the device you are debugging on.
精彩评论