ADB命令与monkey

adb devices查看已连接的设备

adb install package.apk

adb shell monkey 1000 随机操作1000次当次操作可能会 

adb无法使用,提示error: unknown host service的解决办法

解决方案在这里http://blog.csdn.net/liguilicsdn/article/details/50902194

当此命令执行后会有反馈

Events injected: 1000这里如果数值等于你的输入值则说明执行了1000次,如果小于你的数值则说明中间出现了异常

还有些注释比如//activityresuming(com.android.setting)记录app从前台到后台后又进入前台会记录

adb logcat | grep START这里是logcat 其中|是Linux中管道的意思把前一个命令的输出作为下一个的输入,grep START是抓取日志中包含START的日志信息

adb shell monkey -p a66weding.com.jiehuntong 1000 给指定的包(你的应用)打压力1000次  -p 是package的命令缩写a66weding.com.jiehuntong 是你指定应用的包名

adb shell monkey -p a66weding.com.jiehuntong 1000  --throttle 1000  解释: --throttle 1000是每个指令之间的间隔时间也可以这样写adb shell monkey -p a66weding.com.jiehuntong  1000 100 这里的前面1000是延时,100是次数

adb shell monkey -v -p a66weding.com.jiehuntong 1000 -v 的意思是列出详细执行的命令,以及所占百分比

adb shell monkey -v -p a66weding.com.jiehuntong 1000 --pct--touch 100 100 --pct--touch 设置点击事件百分比,

原文地址:https://www.cnblogs.com/lizhanqi/p/6127775.html