Android Stress Test Command Monkey detailed _android

Source: Internet
Author: User

First, what is Monkey?
Monkey is a tool that comes with the SDK.

Second, the purpose of the monkey test?
: The tool is used for stress testing. The developer then combines the monkey print logs and the system-printed logs with the problems that occur in the outcome test.

Third, the characteristics of the monkey test?
Monkey test, all events are randomly generated, without any subjectivity.

Iv. detailed instructions for monkey

1). Standard Monkey Command
[adb shell] monkey [options] <eventcount>, for example:
The ADB shell monkey-v--------produces 500 random events that affect all activity in the system (in fact, not all of the activity, but the Intent.category_launcher or intent.ca Activity of Tegory_monkey).
It's just a simple example, and there's 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 code as follows:

--HELP: Printing Help information
-V: Specifies the level of detail for printing information, one-V increases one level, and the default level is 0.

2: Event Options
Copy Code code as follows:

-S: Specifies that a random event seed value is generated, and the same seed value produces the same sequence of events. such as:-S 200
--throttle: The interval after each event--reducing the system's pressure (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%, with the following option:
--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-appswitch <percent> (switching between activity),--pct-anyevent <percent> (Any event)

3: Constraint options
Copy Code code as follows:

-P: Specifies a valid package (if not specified, it is valid for all package in the system), one-p corresponds to a valid package, such as:-P com.ckt-p Com.ckt.asura;
The-c:activity must contain at least one specified category before it can be started;

4: Debugging Options
Copy Code code as follows:

--dbg-no-events: Initializes an activity that starts, but does not produce any events.
--HPROF: The analysis report is generated immediately before and after the event sequence is sent--it is generally recommended to specify the item.
--ignore-crashes: Ignore crashes
--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 crash problems with local methods
--WAIT-DBG: Know that the debugger is connected to perform the monkey test.

How far simple monkey command:

Copy Code code as follows:
adb shell monkey-p com.xy.android.junit-s 500-v 10000

However, in order to ensure the integrity of the test quantity, we usually do not exit the stress test immediately when the error occurs. Monkey test commands are as follows

Copy Code code 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 the role of the package: Com.ckt.android.junit
Seed value of generation time series: 500
Ignore program crashes, ignore timeouts, monitor local program crashes, detail level 2, resulting in 10,000 events.

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.