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