Android Monkey full parameters (including hidden parameters)

Source: Internet
Author: User

http://blog.csdn.net/jlminghui/article/details/38238443

The parameters are as follows:



Note: The command in the following example is the Windows CMD Command window running environment, the parameters listed on the foreign official website are not all parameters, the more complete parameters to see Monkey source code.

First, the general

1,-help

function : Lists the simple usage.

Example: adb shell monkey-help

Note: This parameter is rarely used, and lazy practice directly enters adb shell monkey to see a list of simple usages.

2,-V

Action : Each-V on the command line will increase the verbosity of the feedback information.

Level0 (default) provides less information than startup, test completion, and final results.

LEVEL1 provides more detailed test information, such as event information sent individually to the activity.

LEVEL2 provides more setup information, such as selected or unchecked activity information in the test.

example : adb shell monkey-v 10

Note: The more commonly used is-v-v-V, which is the most detailed information that is typically saved to the specified file for the developer to find the cause of the bug.

II. Events

1,-S <seed>

Function: The seed value of the pseudo-random number generator. If you run monkey again with the same seed value, the same sequence of events will be generated.

Example: adb shell monkey-s 12345-v 10

2 、--Throttle <milliseconds>

action : Inserting a fixed time (ms) delay between events, you can use this setting to slow down the monkey, and if you do not specify this parameter, there will be no delay between events, and the event will be generated as quickly as possible.

example : adb shell monkey--throttle 300-v 10

Note: Common parameters, typically set to 300 milliseconds, are typically set to 300 milliseconds here because of the fastest 300 milliseconds or so of an action event for the actual user operation.

3 、--Pct-touch <percent>

effect : Adjusts the percentage of touch events. (Touch event refers to a down-up event in the screen that is pressed and lifted at a certain point on the screen)

example : adb shell monkey--pct-touch 100-v 10

Note: Commonly used parameters, this parameter is set to adapt to the operation of the current application under test, such as an application 80% is touch, you can set the percentage of this parameter to a corresponding higher percentage.

4 、--pct-motion <percent>

effect : Adjusts the percentage of motion events. (Motion events are made up of a down event on the screen, a series of pseudo-random movement events, and an up event)

example : adb shell monkey--pct-motion 100-v 10

Note: Commonly used parameters, note that the moving event is a straight line slide, the following trackball movement contains the curve movement.

5 、--Pct-trackball <percent>

effect : Adjusts the percentage of rolling ball events. (A rolling ball event consists of one or more random movement events, sometimes accompanied by a click event)

example : adb shell monkey--pct-trackball 100-v 10

Note: The parameters are not used very often, but now the mobile phone has almost no rolling ball, but the rolling ball event contains a curve sliding event, which can be selected when the program needs curve sliding.

6 、--Pct-nav <percent>

effect : Adjusts the percentage of basic navigation events. (navigation events consist of events triggered by the up and down buttons on the direction input device)

example : adb shell monkey--pct-nav 100-v 10

Note: Infrequently used operations.

7 、--Pct-majornav <percent>

effect : Adjusts the percentage of the primary navigation event. (These navigation events often result in action events in the UI interface, such as the middle key of the 5-way keyboard, the fallback button, the menu button)

example : adb shell monkey--pct-majornav 100-v 10

Note:


8 、--Pct-syskeys <percent>

effect : Adjusts the percentage of system events. (These keys are usually reserved for use by the system, such as home, back, Start call, End Call, volume adjustment)

example : adb shell monkey--pct-syskeys 100-v 10


Note: not commonly used.

9 、--Pct-appswitch <percent>

effect : Adjusts the percentage of activity startup. (In a random interval, monkey will execute a startactivity () call as a way to maximize the coverage of all activity in the package being tested)

example : adb shell monkey--pct-appswitch 100-v 5

Note: not commonly used.

Ten 、--Pct-anyevent

effect : Adjusts the percentage of other events. (This includes all other events, such as keystrokes, other buttons that are not commonly used on the device, etc.)

example : adb shell monkey--pct-anyevent 100-v 5

Note: Not used frequently.

Third, the constraint conditions

1,-P <allowed-package-name>

role : If you specify one or more packages, monkey will only allow access to the activity in those packages. If your application needs to access the activity outside of these packages (such as selecting a contact), you need to specify these packages. If you do not specify any packages, monkey will allow the system to initiate activity for all packages. Specify multiple packages, use multiple-p, and a-p followed by a package name.

example : adb shell monkey-p com.android.browser-v 10

Note: Common parameters.

  2,-C <main-category>

role : If you specify one or more categories, monkey will only allow the system to start the activity listed in these specified categories. If you do not specify any categories, MONKEY will select Activity,intent.category_launcher and Intent.category_monkey listed in the Bisceglie category. Specifies that multiple categories use multiple-C, and each-c specifies a category.

Example :

Note: not commonly used.

  3 、--dbg-no-events

function : Set this option, monkey will perform an initial boot, enter a test activity, and will not generate the event further. For best results, combine parameter-V, one or more package constraints, and a non-0 value that keeps monkey running for 30 seconds or longer, providing an environment to monitor transitions between packages called by the application.

Example :

Note: not commonly used.

  4 、--hprof

role : Set this option to generate a profilling report before and after the monkey generates the event sequence. Generate large files (~5MB) under the Data/misc path, so use caution.

Example :

Note: not commonly used.

  5 、--ignore-crashes

action : Typically, monkey stops running when an app crashes or an exception occurs. If this key is set, Monkey will continue to send events to the system until the event count is complete.

Example :

Note: commonly used.

  6 、--ignore-timeouts

role : Typically, any time-out errors (such as the "Application Not Responding" dialog box) monkey will stop running, setting this key, Monkey will continue to send events to the system until the event count is complete.

Example :

Note: commonly used.

  7 、--ignore-security-exception

role : Typically, monkey stops running when a program has a licensing error (such as initiating some activity that requires permission) to cause an exception. Setting this, monkey will continue to send events to the system until the event count is complete.

Example :

Note: commonly used.

  8 、--Kill-process-after-error

function : Typically, when Monkey is stopped due to an error, the wrong application will continue to be in the running state. Setting this will notify the system to stop the process where the error occurred. Note that the normal (successful) end does not stop the process from starting, and the device simply stays in the final state after the end event.

Example :

Note:

9 、--Monitor-native-crashes

role : Monitors and reports on crash events for local code in the Andorid system. If you set--kill-process-after-error, the system will stop running.

Example :

Note:

Ten 、--wait-dbg

function : Stop monkey in execution until there is a debugger connected to it.

Example :

Note:

 

=============================================================================================================== ========

The following parameters are listed in the Monkey official website, but can be displayed in the command line help, listed first, then take the time to organize their use

--pct-rotation
--pct-pinchzoom
--pkg-blacklist-file
--pkg-whitelist-file
--randomize-throttle
--port
--setup
-F
--profile-wait
--device-sleep-time
--randomize-script
--script-log
--bugreport
--periodic-bugreport
-H

Android Monkey full parameters (including hidden parameters)

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.