ADB Shell Monkey Command

Monkey Commands

Adb shell monkey –p <package_name>
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

–throttle delay between each action.
-s (seed) which use to generate random actions, if two command with same seed value, the actions order will be same. It can be used to repro the issue with same actions. The output of two monkey commands will be same if set seed value as same.
–pct-touch percent of touching. Click event.
–pct-motion action event.
–pct-trackball.
–pct-nav basic navigation, using up, down, left and right in the input device.
–pct-majornav back, menu, and OK(middle) key and soft navigation keys.
–pct-syskeys System navigation: HOME, BACK, Volume, Phone Call key, hard keys.
–pct–appswitch Start activity event. Switch activity in the app.

–pct-anyevent any event.
–ignore-crashes ignore crashes and exception. CRASH in monkey log.
–ignore-timeouts ignore ANR and continue actions. ANR log filter in monkey log is “ANR in “. CPU, memory, exception information will be displayed in the following log.
Monkey will stop when meet crash and ANR.

Repeatable scenarios (serial actions):
Adb shell monkey –f
-v list all actions has been executed.
// Event percentages:
// 0: 20.0% –pct-touch
Percent of touch, different types of click event.
ACTION_UP, ACTION_DOWN, ACTION_MOVE (Trackball), Rotation.
// 1: 20.0% –pct-motion
Action event.
// 2: 0.0%
// 3: 0.0%
// 4: -0.0%
// 5: 30.0%
// 6: 30.0%
// 7: 0.0%
// 8: 0.0%
// 9: 0.0%
// 10: 0.0%

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值