Monkey-monkey commands

Source: Internet
Author: User

Four categories-common options, event options, constraint options, debugging options

1. Common options

-- Help: Print help information

-V: Specifies the detail level of the printed information. A-V is added with a default value of 0. It is used to specify the level of feedback information (the information level is the log details), which is divided into three levels in total.

Log Level 0

Default Value. Only a small amount of information such as startup prompt, test completion, and final result is provided.

Log Level 1

Provides detailed logs, including information about each event sent to the activity.

Log Level 2

The most detailed log, including the activity information selected/not selected in the test

2. Event options

-S: Specifies the random event seed value. The same seed value produces the same event sequence. For example,-S 200

-- Throttle: The interval after each event ends-reduce the system pressure (if not specified, the system will send the event sequence as soon as possible ). For example, -- throttle 100

-- PCT-touch: Specifies the percentage of touch events, for example, -- PCT-touch 5%. Related options include:

-- PCT-motion <percent> (slide event), -- PCT-trackball <percent> (trackball event), -- PCT-nav <percent> (navigation event up/down/left/right), -- PCT-majornav <percent> (main navigation event back key, menu key), -- PCT-syskeys <percent> (system key event home, back, startcall, endcall, volumecontrol), -- PCT-history witch <percent> (activity switching), -- PCT-anyevent <percent> (any event)

3. Constraints

-P: specify a valid package (if not specified, it is valid for all packages in the system). A-P corresponds to a valid package, for example,-p com. CKT-p com. CKT. asura;

Parameter-P is used to restrict the use of this parameter to specify one or more packages (that is, Apps ). After a package is specified, Monkey only allows the system to start the specified app. If no package is specified, monkey allows the system to start all apps on the device.

-C: the activity must contain at least one specified category before it can be started. Otherwise, the activity cannot be started.

4. debugging options

-- Dbg-no-events: Initialize the started activity, but no event is generated.

-- Hprof: specifies that an analysis report is generated immediately before and after the event sequence is sent. It is generally recommended that this item be specified.

-- Ignore-crashes: Ignore crash

-- Ignore-timeouts: Ignore timeout

-- Ignore-security-exceptions: Ignore security exceptions

-- Kill-process-after-error: Kill the process directly after an error occurs.

-- Monitor-native-crashes: tracking local method crashes

-- Wait-dbg: The monkey test is executed only when the debugger is connected.

5. A simple monkey command:

ADB shell monkey-P com. XY. Android. JUnit-S 500-V 10000

However, in order to ensure the test quantity is complete, we generally do not exit the stress test immediately when an error occurs. The monkey test command is as follows:

ADB shell monkey-p com. XY. android. JUnit-S 500 -- ignore-crashes -- ignore-timeouts -- Monitor-native-crashes-v 10000> E: \ monkey_log \ java_monkey_log.txt

6. Monkey package: COM. CKT. Android. JUnit

Seed value of time series: 500

Ignore program crash, ignore timeout, monitor local program crash, level of details is 2, 10000 events are generated.

Monkey-monkey commands

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.