Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
295 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 Reply

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) }'

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...