Android Command Monkey stress test, detailed

Source: Internet
Author: User

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.category_monkey 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

--help: Printing help
-V: Specifies the level of detail for printing information, a-V adds a level, and the default level is 0.
2: Event option
-S: Specifies that random event seed values are generated, and the same seed values produce the same sequence of events. such as:-S,
--throttle: The 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
--pct-touch: Specifies the percentage of touch events, such as:--pct-touch 5%, with 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 event Home, back, Startcall, Endcall, Volumeco Ntrol),--pct-appswitch <percent> (toggle between activity),--pct-anyevent <percent> (arbitrary event)
3: Constraint options

-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
--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:
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
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
Ignores program crashes, ignores timeouts, monitors local program crashes, and details level 2, resulting in 10,000 events.

Reference Links:

http://blog.csdn.net/huangbiao86/article/details/8490743

Http://www.cnblogs.com/wfh1988/archive/2010/11/16/1878224.html

Android Command Monkey stress test, detailed

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.