1

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?

ЯegDwight
  • 24,821
  • 10
  • 45
  • 52
user1393839
  • 11
  • 1
  • 2

4 Answers4

3

Command :

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

worked on android 2.3

Alexis Pigeon
  • 7,423
  • 11
  • 39
  • 44
Helder
  • 31
  • 3
1
  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.

2Dee
  • 8,609
  • 7
  • 42
  • 53
Satya Ch
  • 11
  • 1
0

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!

Community
  • 1
  • 1
dcow
  • 7,765
  • 3
  • 45
  • 65
  • 1
    There is no answer for my question, or i may not understand you. sory for that. Just like i said, i dont know how monkey process is called. I have Windows system, ddms is not a solution for me And console doesnt see com.android.commands.monkey process – user1393839 May 14 '12 at 13:51
  • What do you mean `ddms` is not a solution? It's included with the SDK. If you have `monkey` and `adb` you should have ddms.. – dcow May 14 '12 at 14:10
  • I need to kill monkey only by adb cmd. I know i can do this by DDMS, but i need only adb command – user1393839 May 14 '12 at 14:25
  • Then why haven't you tried using the `adb` command in the linked solution: `$ adb shell ps | awk '/com\.android\.commands\.monkey/ { system("adb shell kill " $2) }'` – dcow May 14 '12 at 16:32
  • ddms is not a solution for me And console doesnt see com.android.commands.monkey process. That's what i wrote yesterday. I tried – user1393839 May 15 '12 at 05:46
  • So what processes *are* running when you list them with `adb`? It might have changed to something very similar... you should check rather than just floundering around.. – dcow May 15 '12 at 10:07
0

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) }'
ЯegDwight
  • 24,821
  • 10
  • 45
  • 52
user1136474
  • 203
  • 1
  • 3
  • 11