Categories
adb android shell

Emulate Force Stop from ADB/Shell Commands

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?

Cheers.