monkey

1,adb install xx.apk:把指定的安裝包apk文件安裝到測試設備中
2,adb shell monkey :給指定的設備發(fā)送壓力測試,number是要測試的次數(shù)。執(zhí)行這個命令的效果就相當于有個手指在你的手機上亂點。我嘗試了10000次,結果費了好一會兒功夫才把手機恢復到我想到的效果。
3,adb shell monkey -p pkgname :同上面效果一樣,只是對指定包名(pkgname)apk進行測試。
4,Monkey高級參數(shù)的應用
4.1.throttle參數(shù):指定事件之間的間隔時間
adb shell monkey -throttle :milliseconds是時間值 ,單位毫秒
4.2.seed參數(shù):偽隨機數(shù)生成器的seed 值。
adb shell monkey -s :如果用相同的 seed 值再次運行 Monkey ,它將生成相同的事件序列。
4.3.touch:設置觸摸事件
adb shell monkey -pct-touch :指定touch事件的百分比percent
4.4.motion:設置動作事件
adb shell monkey -pct-motion :指定motion事件的百分比percent
4.5.trackball:設置軌跡球事件
adb shell monkey -pct-trackball :指定軌跡球事件百分比percent
4.6.nav:導航事件設置
adb shell monkey -pct-nav :指定基本導航事件百分比percent
4.7.majornav:設置主要導航事件
adb shell monkey -pct-majornav :設定主要導航事件百分比percent,兼容中間鍵,返回鍵,菜單按鍵
4.8.syskeys:設置事件
adb shell monkey -pct-syskeys :設定系統(tǒng)事件百分比percent,比如HOME,BACK,撥號及音量調(diào)節(jié)等事件。
4.9.appswitch:啟動Activity事件
adb shell monkey -pct-appswitch :設定啟動activity的事件百分比percent
4.10.anyevent:不常用事件設置
adb shell monkey -pct-anyevent :設定不常用事件地百分比
4.11.crashes :程序崩潰事件設置
adb shell monkey -ignore-crashes :忽略崩潰和異常事件
4.12.timeouts:超時事件設置
adb shell monkey -ignore-timeouts :忽略超時事件

monkey -s 35 -v 1000

最后編輯于
?著作權歸作者所有,轉載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

相關閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容