Android Stress test Command Monkey detailed "Turn"

Source: Internet
Author: User

This article was reproduced from: http://www.jb51.net/article/48557.htm

Font: [Increase decrease] Type: Reprint time: 2014-03-29 I want to comment

This article mainly describes the Android Monkey command in detail, Monkey is a tool included in the SDK, the tool is mainly used for stress testing, the need for friends can refer to the following

What is Monkey?
Monkey is a tool that comes with the SDK.

Second, 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.

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

Four, Monkey command detailed

1). Standard Monkey Command
[adb shell] monkey [options] <eventcount>, for example:
ADB shell monkey-v--------generates 500 random events that act on all activity in the system (not all activity, but include intent.category_launcher or intent.ca Tegory_monkey's activity).
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 CodeThe 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 CodeThe 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). Example:--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> (toggle between activity),--pct-anyevent <percent> (Any event)
3: Constraint optionsCopy CodeThe 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 in order to be activated, otherwise it will not start;
4: Debug Options
Copy CodeThe code is as follows:
--dbg-no-events: Initializes the activated activity, but does not produce any events.
--HPROF: An analysis report is generated immediately before and after the event sequence is specified-the item is generally recommended.
--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 CodeThe 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 CodeThe code is as follows: adb shell monkey-p com.xy.android.junit-s--ignore-crashes--ignore-timeouts--monitor-native-crashes-v-V 100 XX > 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
Ignores program crashes, ignores timeouts, monitors local program crashes, and details level 2, resulting in 10,000 events.

Android Stress test Command Monkey detailed "Turn"

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.