App Stability Test-monkey execution

Source: Internet
Author: User

Monkey all options available on the command line

Example
adb shell monkey-p cn.lejiayuan.alpha--pct-touch--pct-motion--pct-trackball 1--pct-nav 1--pct-majornav--pc T-syskeys--pct-appswitch 20-v-v-v--throttle 200-s 3333333--kill-process-after-error 10000

Conventional
--help
Lists the simple usage.

-V
Each-V of the command line increases the level of feedback information.
Level 0 (default) provides less information than startup prompts, test completion, and end results.
Level 1 provides more detailed testing information, such as events sent individually to the activity.
Level 2 provides more detailed setup information, such as the activity that was selected or unchecked in the test.

Log levels Level 0
* Sample adb shell monkey-p com.htc.weather–v 100
Describe default values, providing only small amounts of information such as startup hints, test completion, and final results

Log levels Level 1
* Sample adb shell monkey-p com.htc.weather–v-v 100
Description provides a more detailed log, including each event message sent to the activity

Log Levels Level 2
* Example Adbshell monkey-p com.htc.weather–v-v–v 100
Description of the most detailed log, including the selected/unchecked activity information in the test

Event

-S

    • Example:
      Monkey Test 1:adb shellmonkey-p com.htc.weather–s 10 100
      Monkey Test 2:adb shellmonkey-p com.htc.weather–s 10 100
      The effect of the two Tests is the same, because the simulated sequence of user actions (a sequence of operations consisting of each operation in a certain order) is the same. The sequence of operations is randomly generated, but as long as we specify the same seed value, we can guarantee that the random sequence of operations generated by the two Tests is exactly the same, so this sequence of operations is pseudo-random;

--throttle

    • Example: adb shellmonkey-p com.htc.weather–throttle 3000 100

--pct-touch

    • Example: adb shellmonkey-p com.htc.Weather--pct-touch 10 1000

--pct-motion

    • Example: adb shellmonkey-p com.htc.Weather--pct-motion 20 1000

--pct-trackball

    • Example: adb shellmonkey-p com.htc.Weather--pct-trackball 30 1000

--pct-nav

    • Example: adb shellmonkey-p com.htc.Weather--pct-nav 40 1000

--pct-majornav

    • Example: adb shellmonkey-p com.htc.Weather--pct-majornav 50 1000

--pct-syskeys

Example: adb shellmonkey-p com.htc.Weather--pct-syskeys 60 1000
--pct-appswitch

Example: adb shellmonkey-p com.htc.Weather--pct-appswitch 70 1000
--pct-anyevent

--pct-anyevent 1001000* Specifies the percentage of multiple types of events:
adb shell Monkey-pcom.htc.weather--pct-anyevent--pct-appswitch 50 1000
Note: The total percentage of each event type cannot exceed 100%;

Constraint restrictions
-P

Specify a package: adb shell monkey-p com.htc.Weather 100
Description: Com.htc.Weather is the package name, 100 is the event count (i.e. let the monkey program simulate 100 random user events).
Specify multiple packages: adb shell monkey-p com.htc.weather–pcom.htc.pdfreader-p com.htc.photo.widgets 100
Do not specify package: adb shell Monkey 100
Description: Monkey randomly launches the app and sends 100 random events.
To view all the packages in the device, execute the following command in the cmd window:
ADB shell
CD Data/data
Ls
-C

Debugging
--dbg-no-events
Set this option, monkey will perform the initial boot, enter into a test activity, and no further events will be generated. For best results, combine it with-V, one or several package constraints, and a non-0 value that keeps monkey running for 30 seconds or longer, providing an environment to monitor conversions between packages called by the application.

--hprof
Set this option to generate the profiling report immediately before and after the monkey event sequence. This will generate a large file (~5MB) in the Data/misc, so use it with care.

--ignore-crashes
Typically, monkey stops running when an application crashes or any runaway exception occurs. If this option is set, Monkey will continue to send events to the system until the count is complete.

    • Example 1:adb shellmonkey-p com.htc.Weather--ignore-crashes 1000
      Even if the weather program crashes during the test, Monkey continues to send events until the number of events reaches 1000;
    • Example 2:ADB Shell monkey-p Com.htc.Weather 1000
      During the test, if the weather program crashes, Monkey will stop running.

--ignore-timeouts
Typically, monkey stops running when an application has any time-out errors, such as the application not responding dialog box. If this option is set, Monkey will continue to send events to the system until the count is complete.

--ignore-security-exceptions
Typically, when an application has a licensing error (such as starting an activity that requires some permission), Monkey will stop running. If this option is set, Monkey will continue to send events to the system until the count is complete.

--kill-process-after-error
Typically, when Monkey is stopped due to an error, the application that is faulted will continue to be in the running state. When this option is set, the system will be notified of the process of stopping the error. Note that the normal (successful) end, and does not stop the process from starting, the device simply stays in the final state after the end event.

--monitor-native-crashes
Monitor and report crash events for native code in your Android system. If--kill-process-after-error is set, the system will stop running.

--wait-dbg
Stop monkey in execution until there is a debugger connected to it.

App Stability Test-monkey execution

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.