偽隨機(pseudo-random)
的用戶事件流(如按鍵輸入、觸摸屏輸入、手勢輸入等),可以對待測的目標利用或全部Android系統進行壓力測試。因此Monkey測試是1種為了測試軟件的穩定性、硬朗性的快速有效的方法基本語法:
$ adb shell monkey [options] <event-count>
如果不指定options
,即類似于使用命令adb shell monkey 1000
,那末將會對全部系統中安裝的package發送事件流,換種說法就是對全部Android系統進行Monkey壓力測試
下面是1個對指定利用(Android自帶的系統設置
利用)進行Monkey測試的例子,發送的事件流數目為1000:
adb shell -p com.android.settings 1000
獲得選項列表,Android 4.4版本中輸入adb shell monkey
,會顯示選項列表以下:
usage: monkey [-p ALLOWED_PACKAGE [-p ALLOWED_PACKAGE] ...]
[-c MAIN_CATEGORY [-c MAIN_CATEGORY] ...]
[--ignore-crashes] [--ignore-timeouts]
[--ignore-security-exceptions]
[--monitor-native-crashes] [--ignore-native-crashes]
[--kill-process-after-error] [--hprof]
[--pct-touch PERCENT] [--pct-motion PERCENT]
[--pct-trackball PERCENT] [--pct-syskeys PERCENT]
[--pct-nav PERCENT] [--pct-majornav PERCENT]
[--pct-appswitch PERCENT] [--pct-flip PERCENT]
[--pct-anyevent PERCENT] [--pct-pinchzoom PERCENT]
[--pkg-blacklist-file PACKAGE_BLACKLIST_FILE]
[--pkg-whitelist-file PACKAGE_WHITELIST_FILE]
[--wait-dbg] [--dbg-no-events]
[--setup scriptfile] [-f scriptfile [-f scriptfile] ...]
[--port port]
[-s SEED] [-v [-v] ...]
[--throttle MILLISEC] [--randomize-throttle]
[--profile-wait MILLISEC]
[--device-sleep-time MILLISEC]
[--randomize-script]
[--script-log]
[--bugreport]
[--periodic-bugreport]
COUNT
上一篇 configure: error: libmpfr not found or uses a different ABI (including static vs
下一篇 iis當前端口占用解決方案