Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
291 views
in Technique[技术] by (71.8m points)

android - How do I stop the monkey madness?

I'm using the monkey tool to run a test of my Android application. For example, I might do a run like the following:

adb shell monkey -p com.myapp -v 10000

However, if I change my mind and need to cancel the test, there doesn't seem to be a way to do so that doesn't involve waiting multiple minutes for the damned monkey to finish most or all of its run.

Killing the adb shell process on my mac doesn't solve the problem. Killing the com.myapp process on my phone using ddms doesn't work. Unplugging my phone doesn't work.

How do I cancel the monkey madness?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You can kill the monkey process just doing this:

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

56.9k users

...