<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    統(tǒng)計

    留言簿(1)

    DB

    Others

    QA

    Tech Website

    閱讀排行榜

    評論排行榜

    UI/Application Exerciser Monkey

    The Monkey is a program that runs on your emulator or device and generates pseudo-random streams of user events such as clicks, touches, or gestures, as well as a number of system-level events. You can use the Monkey to stress-test applications that you are developing, in a random yet repeatable manner.

    Overview

    The Monkey is a command-line tool that that you can run on any emulator instance or on a device. It sends a pseudo-random stream of user events into the system, which acts as a stress test on the application software you are developing.

    The Monkey includes a number of options, but they break down into four primary categories:

    • Basic configuration options, such as setting the number of events to attempt.
    • Operational constraints, such as restricting the test to a single package.
    • Event types and frequencies.
    • Debugging options.

    When the Monkey runs, it generates events and sends them to the system. It also watches the system under test and looks for three conditions, which it treats specially:

    • If you have constrained the Monkey to run in one or more specific packages, it watches for attempts to navigate to any other packages, and blocks them.
    • If your application crashes or receives any sort of unhandled exception, the Monkey will stop and report the error.
    • If your application generates an application not responding error, the Monkey will stop and report the error.

    Depending on the verbosity level you have selected, you will also see reports on the progress of the Monkey and the events being generated.

    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 prefacing adb 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.

    CategoryOptionDescription
    General--helpPrints a simple usage guide.
    -vEach -v on the command line will increment the verbosity level. Level 0 (the default) provides little information beyond startup notification, test completion, and final 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>Adjust percentage of motion events. (Motion events consist of a down event somewhere on the screen, a series of pseudo-random movements, and an up event.)
    --pct-trackball <percent>Adjust percentage of trackball events. (Trackball events consist of one or more random movements, sometimes followed by a click.)
    --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 as the 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 maximizing coverage 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-used buttons 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 system to visit activities within those packages. If your application requires access to activities in other 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 activities in 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 category Intent.CATEGORY_LAUNCHER or Intent.CATEGORY_MONKEY. To specify multiple categories, use the -c option multiple times — one -c option per category.
    Debugging--dbg-no-eventsWhen specified, the Monkey will perform the initial launch into a test activity, but will not generate any further events. For best results, combine with -v, one or more package constraints, and a non-zero throttle to keep the Monkey running for 30 seconds or more. This provides an environment in which you can monitor package transitions invoked by your application.
    --hprofIf set, this option will generate profiling reports immediately before and after the Monkey event sequence. This will generate large (~5Mb) files in data/misc, so use with care. See Traceview for more information on trace files.
    --ignore-crashesNormally, 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 to the system, until the count is completed.
    --ignore-timeoutsNormally, the Monkey will stop when the application experiences any type of timeout error such as 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-exceptionsNormally, 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 specify this option, the Monkey will continue to send events to the system, until the count is completed.
    --kill-process-after-errorNormally, when the Monkey stops due to an error, the application that failed will be left running. When this option is set, it will signal the system to stop the process in which the error occurred. Note, under a normal (successful) completion, the launched process(es) are not stopped, and the device is simply left in the last state after the final event.
    --monitor-native-crashesWatches for and reports crashes occurring in the Android system native code. If --kill-process-after-error is set, the system will stop.
    --wait-dbgStops the Monkey from executing until a debugger is attached to it.

    posted on 2011-08-13 10:14 XXXXXX 閱讀(510) 評論(0)  編輯  收藏 所屬分類: Android Dev

    主站蜘蛛池模板: 麻豆一区二区免费播放网站| 亚洲AV无码成人精品区天堂| ww4545四虎永久免费地址| 五月天婷婷精品免费视频| 亚洲另类古典武侠| 婷婷精品国产亚洲AV麻豆不片| 免费人成网站在线播放| 久久精品网站免费观看| 98精品全国免费观看视频| 两个人看的www免费| 日日摸夜夜添夜夜免费视频| 亚洲国产精品自在自线观看| 亚洲成AV人片久久| 91亚洲精品视频| 亚洲精品成人片在线观看精品字幕| 亚洲成AV人在线观看网址| 国产成人免费a在线视频app| 最近中文字幕mv免费高清视频7 | 又粗又大又黑又长的免费视频| 中文字幕无码一区二区免费| 久久久久久久久久免免费精品| 国产AV日韩A∨亚洲AV电影| 蜜桃传媒一区二区亚洲AV| 亚洲欧美乱色情图片| 亚洲免费网站在线观看| 亚洲精品电影天堂网| 亚洲色欲或者高潮影院| 亚洲一区二区在线视频| 蜜芽亚洲av无码精品色午夜| 亚洲男人天堂av| 国产成人亚洲综合无码| 国产乱弄免费视频| 国产免费观看黄AV片| 免费国产美女爽到喷出水来视频| 暖暖在线日本免费中文| 免费看a级黄色片| 免费国产成人午夜电影| 亚洲A丁香五香天堂网| 国产日产亚洲系列| 亚洲AV午夜成人片| 亚洲精品美女久久久久|