Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 have 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.

like image 944
jfritz42 Avatar asked Aug 02 '11 19:08

jfritz42


2 Answers

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..

like image 75
weakwire Avatar answered Oct 06 '22 01:10

weakwire


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.

like image 34
Nikolay Ivanov Avatar answered Oct 06 '22 01:10

Nikolay Ivanov