Android Monkey Detailed

Source: Internet
Author: User

Monkey is a program running on an Android device or virtual machine that can randomly simulate a series of user actions, click, swipe, and use it for stress testing.

During the monkey run, it generates and sends a series of events to the system and listens to the system: when it assigns one or more programs to it, it restricts other programs in the system, prevents them from running, and when the program crashes, the monkey stops, and the feedback error occurs, and when the program responds, Monkey will stop, and feedback error.

It includes four options: General options, such as setting the number of times the event was generated, event options, constraint options, and debugging options.

General Options :

--HELP: Print Help Information-V: Specifies the level of detail for printing information, a-V adds a level, and the default level is 0.
Event Options:
-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: Interval after each event--reduces 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 event Home, back, Startcall, Endcall, Volumecontrol), --pct-appswitch <percent> (toggle between activity),--pct-anyevent <percent> (any event)
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;
Debugging options:
--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 crash--ignore-timeouts: Ignore timeout--ignore-security-exceptions: Ignore security exception--kill-process-after-error: Kill the process directly after an error--mon Itor-native-crashes: Tracing the crash of the local method--wait-dbg: Know that the debugger is connected to perform monkey testing.
A simple monkey command:
adb shell monkey-p mobi.infolife.ezweather-s 200-v 10000
Generally in the course of testing, in order to test more comprehensive, will ignore crash and for the response, and the log output to the file, the command is as follows:
adb shell monkey-p mobi.infolife.ezweather-s--ignore-crashes--ignore-timeouts--monitor-native-crashes-v-V 10000 > D:\monkey_log\java_monkey_log.txt
Reference: http://www.jb51.net/article/48557.htm,http://developer.android.com/tools/help/monkey.html





Android Monkey 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.