monkey命令使用
adb shell monkey -p com.test -v 30000 >E:\text.txt
adb shell monkey -p 包名 -v 執(zhí)行次數(shù) >導出的路徑
<br />##還有一種更復雜的方式
adb shell monkey -p com.lenovo.ideafriend --ignore-crashes --ignore-timeouts --ignore-native-crashes --pct-touch 30 -s 1 -v -v --throttle 200 100000 2>/sdcard/error.txt 1>/sdcard/info.txt
| 參數(shù) | 描述 |
|---|---|
| p com.lenovo.ideafriend | 只僅針對特定包名進行測試 |
說明
| 參數(shù) | 描述 |
|---|---|
| p com.lenovo.ideafriend | 只僅針對特定包名進行測試 |
--ignore-crashes | 忽略應用程序崩潰(Force & Close錯誤),繼續(xù)發(fā)送執(zhí)行事件,直到事件數(shù)執(zhí)行完成
--ignore-timeouts | 忽略應用程序發(fā)生ANR(Application No Responding)錯誤時,直到事件數(shù)執(zhí)行完成
--ignore-native-crashes | 忽略本地應用程序發(fā)生奔潰,直到事件數(shù)執(zhí)行完成
--pct-touch 30 | 調(diào)整觸摸事件為30%。即整個事件過程中觸摸事件占30%
-s 1 | 偽隨機數(shù)生成器seed值。Seed值為1。相同的seed值再次執(zhí)行monkey,將產(chǎn)生相同的事件序列。
-v -v | 日志級別為Leve1 1。將提供較為詳細的日志,包括每個發(fā)送到Activity的事件信息
--throttle 200 | 事件之間延時200毫秒??梢钥刂苖onkey的執(zhí)行速度,如果不指定該選項,monkey事件間將不會延時。
100000 | 執(zhí)行事件數(shù)為10萬次2>/sdcard/error.txt|Leve1 2日志保存到sdcard上的error.txt中1>/sdcard/info.txt|Leve1 1日志保存到sdcard上的info.txt中
<br />
具體詳情請看:http://blog.csdn.net/handongyu2011/article/details/52185374