Accepted answer

i understand you want to stop your app on the emulator. for this you can open up the devices window (in the debug perspective), select the process and then press the stop button on the same window.


add breakpoint to your code where you want to stop and then run it in debug mode by pressing f11.


android zombies figure 1 - many zombies were killed during the research of this answer

killing an android application java vm process at the os level is not recommended. unfortunately, this is exactly what the eclipse device window "stop" does, as does system.exit() and the shell "kill" command.

this subverts the normal app life-cycle methods such as onstop(), ondestroy(), and finalize().

many apps require these methods for graceful exit (for ex. if they use system objects like sensor, mediaplayer, equalizer, visualizer, etc).

these system objects hang around with zombie death grips on system resources if release() is not called explicitly during these life-cycle methods. see fig. 1 above. this can prevent an app from restarting, and even require a reboot. that is the ungraceful aspect.

the only solution is to make sure you always exit your app cleanly with a call to onstop() or ondestroy() or at least finalize(). the debugger does this, as does the os on shutdown.

you can set your app to trap sig_hup events in order to force a graceful exit from the command line.

the only time you would kill the app vm is in anr (already a zombie) state. anrs must be fixed. never deploy an app that can enter this state. it is extremely rude.

you can use google analytics and the play store to monitor for these in deployment. you don't want angry users giving single star anr reviews after having to reboot due to your zombie application. very bad.

remember that android is linux: treat it like a real os, and respect the app life-cycle otherwise you shall surely face the dreaded zombie apocalypse.

ps: if you don't like the zombie analogy, how about fantasia?

enter image description here


see picture: 1. click on ddms; 2. select current app; 3. click on "stop" enter image description here


this answer doesn't deal with eclipse, but since this question comes up in a google search for stopping a running android program, i'd like to offer a command-line method. run adb shell, find the pid of the process you want to kill with ps, for example mine was:

u0_a46 2097 37 175520 19912 ffffffff 40037ebc s net.unternet.bleah.blarg

so then just kill 2097 and you should see the main screen show up again.


working for me.

windows -> open perspective -> other... -> ddms

  1. in the android view, on the left windows, you can see "devices". there should be a list of applications that is running now (emulator or physical devices). click on the application you want to close. normally the name is the name of the package + the name of the application
  2. now click on the symbol of "stop".

to come back to the normal view, you just have to press on the java button on the top right side. you can also do it pressing: windows -> open perspective -> other... -> java


in the "debug" perspective, select the root of the application under "debug" (where the listing of active threads is) and click the stop button.


keep in mind that on android, programs generally only 'stop' if you finish() or the system destroys them when memory is required. why stop at all? you do not need to stop to fix/re-install/re-test, for example.


those who find it tedious switching between perspectives to stop the program (like i did), you can view the devices windows in your current perspective by selecting

windows > show view > other... > android > devices

Related Query

More Query from same tag