Explanation: Android-monkey command

Source: Internet
Author: User

The main description of the android Monkey command in detail, monkey is a tool included in the SDK, the tool is mainly used for stress testing:

First, What is Monkey?

Monkey is A tool that comes with the SDK.

Second, What is the purpose of Monkey testing?

This tool is used for stress testing. the developer then combines the monkey print logs with the system print logs, and the problems that arise in the outcome test.

Third, What are the characteristics of Monkey testing?

Monkey Test , All events are randomly generated, without any subjectivity of the person.

Four, Monkey Command Explanation

1). the standard Monkey command

[adb shell] monkey [options] <eventcount>, for example:

The adb shell monkey-v-------- generates a random event that acts on all the activity in the system(not all activity, but contains activity of intent.category_launcher or intent.category_monkey).

The above is just a simple example, there are usually a lot of options available in the actual situation

2). four categories-- Common Options , Event Options , Constraint Options , Debugging Options

1: Common options

Copy Code The code is as follows :

--help: Printing Help information

-V: Specifies the level of detail for printing information, a -v adds a level , and the default level is 0 .

2: Event Options

Copy Code The code is as follows :

-S: Specifies that random event seed values are generated, and the same seed values produce the same sequence of events. such as: -S 200

--throttle: The time interval after each event-reducing the pressure on the system (if not specified, the system will send the sequence of events as soon as possible). such as:

--throttle 100

--pct-touch: Specifies the percentage of touch events, such as:--pct-touch 5% , related to the following option:

--pct-motion <percent> (sliding events),

--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 events Home ,back ,startcall , endcall , Volumecontrol),

--pct-appswitch <percent> ( switching between activity),

--pct-anyevent <percent>(any event)

3: Constraint options

Copy Code The code is as follows :

-P: Specifies a valid package(if not specified, it is valid for all package in the system ), and one -p corresponds to a valid package, such as: -P com.ckt-p com.ckt.asura;

-C:activity must contain at least one specified category inorder to be activated, otherwise it will not start;

4: Debug Options

Copy Code The code is as follows :

--dbg-no-events: Initializes the activated activity, but does not produce any events.

--hprof: When the item is specified, an analysis report is generated immediately before and after the event sequence is sent - It is generally recommended that the item be specified.

--ignore-crashes: Ignore crashes

--ignore-timeouts: Ignore timeout

--ignore-security-exceptions: Ignoring security exceptions

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

--monitor-native-crashes: Tracing the crash of a local method

--wait-dbg: Know that the debugger is connected to perform the Monkey test.

How far simple Monkey command:

Copy Code The code is as follows :

adb shell monkey-p com.xy.android.junit-s 500-v 10000

However, in order to ensure the complete number of tests in the work, we generally do not exit the stress test immediately when an error occurs. the Monkey Test command is as follows

Copy Code The code is as follows :

adb shell monkey-p com.xy.android.junit-s--ignore-crashes--ignore-timeouts--monitor-native-crashes-v-V 10000 &G T E:\monkey_log\java_monkey_log.txt

six,monkey effect of the package:com.ckt.android.junit

seed value of the resulting time series:500

Ignore program crashes , Ignore timeout , Monitor Local program crashes , The detail level is 2 , resulting in 10000 events .

of course, you can also use some third-party tools to test, such as Love Beta (www.ineice.com)


Explanation: Android-monkey command

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.