0

我最近读了一本关于 android 的书。在那本运行猴子脚本的书中,介绍了以下命令:

adb shell monkey -f myscript.txt 1

我搜索了这个命令并找出 f 的含义。但是当我搜索“1”时,我找不到任何关于它的信息。这个“1”是什么意思?

4

1 回答 1

2
root@droid:/ # monkey
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

1COUNT。这意味着只会执行 1 个“随机”命令。运行的第一个命令monkey是启动默认活动。此技巧用于通过仅提供包名称而无需指定确切的活动名称来启动应用程序。

于 2016-05-17T04:54:52.187 回答