Play the multi-parameter combat of Android Monkey

Source: Internet
Author: User

Monkey set interval time

The parameter throttle is used to control the speed of execution, and if not, we find that it is faster and more visible than the last execution.

Syntax: ADB shell monkey-p package name--throttle set the time interval for each random event

(milliseconds) number of random events

Moneky seed Seed

seed seeds for? It's good to understand that if you want to make the execution trajectory of two commands, add this parameter. For example, the first time you used to find a bug and now want to reproduce it, if the seed is random, it may not reproduce, plus seed.

PS: The initial interface should be consistent at each execution

Syntax: ADB shell monkey-p package name--throttle execution Speed-s seed seed random event number

Monkey Specify an action

If you want to use the Monkey command to do a certain action, rather than n action mixed, it is necessary to specify the action of TA by the parameters, such as--pct-touch click (Touch) action.

Syntax: adb shell MONKEY-V-P package name--pct-touch number of random events performing touch actions

Where-V stands for detailed results, we can see that 0 represents a touch percentage of 100% execution and the remaining 0%.

Think: What would happen if we didn't add--pct-touch to execute the command?

Here, you might ask, what does 1-10 mean? Actually represents a different operation action, here to list:

1: Gesture--pct-motion

2: Zoom--pct-pinchzoom

3: Track Ball--pct-trackball

4: Screen Rotation--pct-rotation

5: Basic navigation events, such as the top, bottom, left, and right actions on the phone--pct-nav

6: Main navigation event, such as Return key, menu key--pct-majornav

7: System navigation events, such as Home button on the phone, dial key, Volume key, etc.--pct-syskeys

8: Toggle Activity--pct-appswitch

9: Keyboard rollover event, for a scene to know, like click on the input box, keyboard pop up, click on other areas, the keyboard to close the--pct-flip

10: Other Events--pct-anyevent

Monkey Ignore crashes and timeouts

Why do you have two parameters? Very simple, we in the use of the app often appear time-out, card-dead condition, once this situation, monkey do not know how to do! So, we need to give him instructions only, generally is to give two parameters, ignore timeouts and ignore crashes.

L Ignore timeout parameter:--ignore-timeouts

L Ignore Crash (Exception) parameters:--ignore-crashes

syntax: adb shell MONKEY-V-P package name--pct-touch--ignore-timeouts--ignore-crashes random number of events

PS: In the actual operation in addition to the above two cases, there may also be the problem of ANR, if it is necessary to find the corresponding log, and then to the development to solve


Play the multi-parameter combat of Android Monkey

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.