How to kill own applications from 'adb shell'?

I can run my own applications using am start -a action -n packagename/activity. How can I kill / stop my own application from adb shell?

+5
source share
3 answers

Chirag deleted it, so here it is again:

adb shell ps | grep com.myapp | awk '{print $2}' | xargs adb shell kill

This should be run outside of the emulator. This is one long Unix command, not four visual separation commands. |is the syntax interpreted by the shell (Ubuntu), which then outputs the output from adb, grep, etc. Next. The emulator runs only ps.

+9
source
adb shell am force-stop packagename
+24
source

adb.

adb shell kill <PID>
+1

All Articles