self-confidence,the source of all the power

导航

logcat and monkey

>>> cmd = 'adb shell monkey -p com.android.music --throttle 1000 -v 10000 --ignore-crashes'
>>> import subprocess
>>> process = subprocess.Popen(cmd,stdout=subprocess.PIPE,stderr=subprocess.STDOUT)
>>> process.terminate()    在这里kill掉进程后,monkey仍然在手机上运行
>>> cmd = 'adb logcat -v time'
>>> process = subprocess.Popen(cmd,stdout=subprocess.PIPE,stderr=subprocess.STDOUT)
>>> process.terminate()   在这里kill掉子进程后,logcat进程在手机上被kill

所以在使用子进程启动monkey后,只是两种方法能杀掉它:

1.adb reboot

2.adb shell ps 找到monkey进程后杀掉。。

posted on 2012-12-28 11:18  漩涡鸣人  阅读(401)  评论(0编辑  收藏  举报