Killing android monkey process via adb only

6.6k Views Asked by At

I have a problem with a monkey process. Starting Monkey is easy, but how to stop it? I know how to stop any process, but I have no idea how the monkey process is called. DDMS shows a "?" process, and that's it, but I have to kill it with an adb command.

Any idea?

4

There are 4 best solutions below

6
On

Just run it with a set number of events:

$ adb shell monkey -p your.package.name -v NUMEVENTS

If you didn't know what you were getting into and ran monkey with a silly number of events (anything with > 3 zeros), you can kill it as described by both the answers in how do I stop the monkey madness!

0
On

Command :

adb shell ps | awk '/com\.android\.commands\.monkey/ { system("adb shell kill " $2) }'

worked on android 2.3

0
On
  1. Do adb shell ps

  2. Search for process name monkey. note down pid of the monkey process (pidvalue)

  3. adb shell kill pidvalue. - where pidvalue is pid of monkey process.

That's all. monkey runner is stopped.

0
On

On an emulator with Android 2.2 the monkey process is called 'app_process'. You can stop it with

adb shell ps | awk '/app\_process/ { system("adb shell kill -9 " $2) }'