monkey用法
来源:互联网 发布:linux进程崩溃 编辑:程序博客网 时间:2024/06/07 08:07
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] 官方文档中未列出,可在ANR和CRASH出现时自动生成log,很有用
[--periodic-bugreport]
COUNT
ps:隐藏事件流--pct-rotation(旋转),Monkey用于内存泄漏测试的时候,可以加该参数
Basic Use of the Monkey
You can launch the Monkey using a command line on your development machine or from a script. Because the Monkey runs in the emulator/device environment, you must launch it from a shell in that environment. You can do this by prefacingadb shell
to each command, or by entering the shell and entering Monkey commands directly.
The basic syntax is:
$ adb shell monkey [options] <event-count>
With no options specified, the Monkey will launch in a quiet (non-verbose) mode, and will send events to any (and all) packages installed on your target. Here is a more typical command line,which will launch your application and send 500 pseudo-random events to it:
$ adb shell monkey -p your.package.name -v 500
Command Options Reference
The table below lists all options you can include on the Monkey command line.
--help
Prints a simple usage guide.-v
Each -v on the command line will increment the verbosity level. Level 0 (the default) provides little information beyond startup notification, test completion, andfinal results. Level 1 provides more details about the test as it runs, such as individual events being sent to your activities. Level 2 provides more detailed setup information such as activities selected or not selected for testing.Events-s <seed>
Seed value for pseudo-random number generator. If you re-run the Monkey with the same seed value, it will generate the same sequence of events.--throttle <milliseconds>
Inserts a fixed delay between events. You can use this option to slow down the Monkey. If not specified, there is no delay and the events are generated as rapidly as possible.--pct-touch <percent>
Adjust percentage of touch events. (Touch events are a down-up event in a single place on the screen.)--pct-motion <percent>
直线滑动
--pct-trackball <percent>
曲线滑动
--pct-nav <percent>
Adjust percentage of "basic" navigation events.(Navigation events consist of up/down/left/right, as input from a directional input device.)--pct-majornav <percent>
Adjust percentage of "major" navigation events.(These are navigation events that will typically cause actions within your UI, such asthe center button in a 5-way pad, the back key, or the menu key.)--pct-syskeys <percent>
Adjust percentage of "system" key events.(These are keys that are generally reserved for use by the system, such as Home, Back, Start Call,End Call, or Volume controls.)--pct-appswitch <percent>
Adjust percentage of activity launches. At random intervals, the Monkey will issue a startActivity() call, as a way of maximizingcoverage of all activities within your package.--pct-anyevent <percent>
Adjust percentage of other types of events. This is a catch-all for all other types of events such as keypresses, other less-usedbuttons on the device, and so forth.Constraints-p <allowed-package-name>
If you specify one or more packages this way, the Monkey will only allow the systemto visit activities within those packages. If your application requires access to activities inother packages (e.g. to select a contact) you'll need to specify those packages as well.If you don't specify any packages, the Monkey will allow the system to launch activitiesin all packages. To specify multiple packages, use the -p option multiple times — one -p option per package.-c <main-category>
If you specify one or more categories this way, the Monkey will only allow the system to visit activities that are listed with one of the specified categories. If you don't specify any categories, the Monkey will select activities listed with the categoryIntent.CATEGORY_LAUNCHER or Intent.CATEGORY_MONKEY. To specify multiple categories, use the -coption multiple times — one -c option per category.Debugging--dbg-no-events
When specified, the Monkey will perform the initial launch into a test activity, butwill not generate any further events.For best results, combine with -v, one or more package constraints, and a non-zero throttle to keep the Monkeyrunning for 30 seconds or more. This provides an environment in which you can monitor packagetransitions invoked by your application.--hprof
目前不可用了!!
--ignore-crashes
Normally, the Monkey will stop when the application crashes or experiences any type of unhandled exception. If you specify this option, the Monkey will continue to send events tothe system, until the count is completed.--ignore-timeouts
Normally, the Monkey will stop when the application experiences any type of timeout error suchas a "Application Not Responding" dialog. If you specify this option, the Monkey will continue to send events to the system, until the count is completed.--ignore-security-exceptions
Normally, the Monkey will stop when the application experiences any type of permissions error,for example if it attempts to launch an activity that requires certain permissions. If you specifythis option, the Monkey will continue to send events to the system, until the count is completed.--kill-process-after-error
Normally, when the Monkey stops due to an error, the application that failed will be leftrunning. When this option is set, it will signal the system to stop the process in which the erroroccurred.Note, under a normal (successful) completion, the launched process(es) are not stopped, andthe device is simply left in the last state after the final event.--monitor-native-crashes
Watches for and reports crashes occurring in the Android system native code. If --kill-process-after-error is set, the system will stop.--wait-dbg
Stops the Monkey from executing until a debugger is attached to it.- monkey用法
- android monkey用法
- monkey 用法2
- Android的monkey用法
- Android monkey用法
- Android中的monkey用法
- Android中的monkey用法
- Monkey的常见用法
- Android中的monkey用法
- Android的monkey用法
- Android Monkey的用法
- Monkey用法示例
- Android Monkey的用法
- Android的monkey用法
- Android的monkey用法
- Android Monkey的用法
- Android 中Monkey的用法
- Android的monkey基本用法
- linux下系统调用劫持ioctl
- elasticsearch搭建
- 过滤和排序
- OpenGL学习资料汇总
- 个人博客搭建小记
- monkey用法
- ArrayList 源代码
- Android-不阻塞的UI线程方法
- 居中布局
- HDU 5514 (ACM 2015 沈阳) Frogs [容斥+记忆化搜索]
- oracle 删除数据库
- AutoEE_V1-自动智能开发平台免费下载通知
- HDU 5120 Intersection
- 卡马克快速平方根(平方根倒数)算法(转)