Monkey Test Example

Source: Internet
Author: User
Tags root access

Monkey is a command-line tool in Android that can be run in the emulator or in the actual device. It sends pseudo-random user event streams (such as key input, touch input, gesture input, etc.) to the system, enabling stress testing of the application under development. Monkey testing is a fast and effective method to test the stability and robustness of the software.

1, environmental inspection

First check the computer adb there is no, run--cmd--adb--enter

or enter the ADB shell

Check that the ADB is configured properly.

650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M01/89/89/wKioL1gXCibR7VYmAADJF7XhjFo590.jpg-wh_500x0-wm_3 -wmp_4-s_68494534.jpg "title=" a.jpg "alt=" Wkiol1gxcibr7vymaadjf7xhjfo590.jpg-wh_50 "/>

2, mobile phone with USB connection computer

Run--cmd carriage return, enter ADB devices

650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M02/89/89/wKioL1gXCjmwwIOsAAAnqpPwCvY872.jpg-wh_500x0-wm_3 -wmp_4-s_3654650682.jpg "title=" b.jpg "alt=" Wkiol1gxcjmwwiosaaanqppwcvy872.jpg-wh_50 "/>

3. Check to get root access to the phone

650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M02/89/89/wKioL1gXCkSDUD4rAAAna2rftNE607.jpg-wh_500x0-wm_3 -wmp_4-s_28005139.jpg "title=" c.jpg "alt=" Wkiol1gxcksdud4raaana2rftne607.jpg-wh_50 "/>

Run--cmd carriage return, enter ADB shell return

If $ is present, the root permission is not obtained.

If # is present, the root permission is obtained.


Do not get root permissions, you need to solve this problem, the general input su can switch to root permissions, if su cannot switch, you need the Android software on the phone to get the root rights of the phone.


4, after obtaining the root permission, enter

Cd/data/data

Find your App package name

650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M00/89/8B/wKiom1gXClqjPAaNAAEtomGCEZU713.jpg-wh_500x0-wm_3 -wmp_4-s_197458452.jpg "title=" d.jpg "alt=" Wkiom1gxclqjpaanaaetomgcezu713.jpg-wh_50 "/>


5, then you can enter:

Monkey–p com.datou.hibrowser –v, -----own APK package name

You can also exit Sehll,
Enter adb shell monkey–p com.datou.hibrowser–v 100 directly on the command line, and during the run, the application in the emulator is constantly switching the screen.
The following command means: Starts the specified application and sends 500 pseudo-random events to it: #monkey-P com.datou.hibrowser-v 500 where-p indicates that the object package –v represents the number of events

Run Show:

650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M01/89/89/wKioL1gXCsSAdddNAAK-wO1oCG0064.jpg-wh_500x0-wm_3 -wmp_4-s_1456854000.jpg "title=" e.jpg "alt=" Wkiol1gxcssadddnaak-wo1ocg0064.jpg-wh_50 "/>

6, other parameters:

Monkey test will automatically stop in the following three scenarios during execution:
A If the monkey is qualified to run on one or several specific packages, it will monitor the
and block it.
B If the application crashes or receives any runaway exceptions, the monkey will stop and error.
C If the application produces an error that the application does not respond (application not responding), Monkey
Will stop and make an error.
It is a stable enough program to pass multiple and different sets of monkey tests.






This article is from "Ghost" blog, please make sure to keep this source http://fangwei009.blog.51cto.com/5234706/1867759

Monkey Test Example

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.