Android Test tool: Using Monkey test

Source: Internet
Author: User

1, Monkey Test is an Android platform for automated testing of a fast and effective means, through the monkey tool can simulate the user touch screen, sliding trackball, buttons and other operations to the simulator or mobile device software on the pressure test, testing the stability of the software, robustness. Its principle is to send a pseudo-random user event stream (such as key input, touch input, gesture input, etc.) to the system for stress testing of the application under development.
2, basic usage of Monkey
Basic syntax is as follows:
$ adb shell monkey [options]
If you do not specify Options,monkey will start in a feedback-free mode and send events to all packages installed in the target environment. The following is a more typical command-line example that launches a specified application and sends 1000 pseudo-random events to it:
$ adb shell monkey-p your.package.name-v number
$ monkey-p (Package Specify the file name-V (number of times and frequency of test) numbers (number of times)
1) View APK package
A, enter the Data/data directory through the CD command, and then use the LS command to see the currently running package
B , adb Shell
# PM List Packages
2) View Activity
A, use command line AAPT dump Xmltree xx.apk androidmanifest.xml
B, adb shell D Umpsys window W |findstr \ |findstr name=
3, mokey test result Analysis
1) test results Export
adb shell monkey-p your.package.name-v numbe R>d:log.txt
2) test result analysis
ANR problem: Search for "ANR"
Crash issue in log: Search for "Exception"
3) event-S
Pseudo-random number generator seed value. If you run monkey again with the same seed value, it will generate the same sequence of events.
Log in to view specific system crash seed values, reproduce system crash test steps
4, End monkey process
Ps|grep monkey
Kill pid

Android Test Tool: Use Monkey test

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.