Take the 2-minute tour ×

Is there a way using the current command line tools (adb, am, pm) to emulate a user pressing Force Stop from the Settings app? Calling kill <pid> from the shell only works so well as to emulate what happens when the system kills a process, but Force Stop does more to remove the memory of an application by removing its ActivityRecord instances that Android saves around.

Is there a shell command we can call to emulate this same behavior?


share|improve this question
add comment

1 Answer

up vote 7 down vote accepted

Use am:

am force-stop: force stop everything associated with <PACKAGE>.

am kill: Kill all processes associated with <PACKAGE>.  Only kills.
  processes that are safe to kill -- that is, will not impact the user

for example:

adb shell am force-stop <PACKAGE>
share|improve this answer
Ack, just noticed this on my ICS device. Any idea when it was introduced? The version of am on my 2.2 devices doesn't have either of these. –  Devunwired Jul 16 '12 at 19:41
If I'm not wrong, they were introduced in Honeycomb –  dtmilano Jul 16 '12 at 19:45
add comment

Your Answer


