First, Monkey
1) What is Monkey?
Monkey is a tool that comes with the SDK. 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.
2) What is the purpose of monkey testing?
This tool is used for stress testing. The developer then combines monkey print logs, system print logs, and test problems to locate and solve problems faster.
3) What are the characteristics of monkey?
The stream of events used by the monkey test is random and cannot be customized, the object being tested is only the app package (APK), and the Monkey object, number of events, type, frequency, etc. can be set.
Second, the environment construction
1) Installing the JDK
First download JDK extract, install: Http://rj.baidu.com/soft/detail/14459.html?ald (JDK and JRE installed under the same file)
Environment configuration: Two folders are generated under the Java folder after the JDK installation is complete.
After the installation is complete, configure the environment variables computer → properties → advanced system settings → advanced → environment variables:
System variables → new java_hone variable. Variable value fill in the JDK installation directory (i install directory: C:\Program files\java\jdk1.7.0_45)
System variable →path (if any) → Edit the value of the variable; If no new Path is created, edit the variable value. %java_hone%\bin;%java_home%\jre\bin; (used when added; separate)
system variable → new classpath variable, variable value filled in.; %java_home%\lib;%java_home%\lib\tools.jar (be careful not to lower the previous.), where the system variable is configured.
Detect if the configuration is successful, run cmd, enter java–version to return to the JDK version and the configuration is successful.
2) Download install Eclipse (official website: http://www.eclipse.org//downloads/) must not be installed, but in order to better conduct Android automation testing, it is best to install.
No installation, direct operation using after decompression (Eclipse.exe)
3) Install SDK: Download SDK for Windows (used for dl-ss.google.com unreachable, amount ... Download the SDK using the following methods.
Modify the C:\Windows\System32\drivers\etc\host file. Add a line:
74.125.237.1 dl-ssl.google.com saved well, once again download the SDK to succeed.
After the download is complete, unzip the android-sdk-windows to D: The packing directory (optional, preferably do not choose c-Drive)
Set the environment variables for tools under SDK: Computer → properties → advanced system settings → environment variables, add D:\android-sdk-windows\platform-tools to the path variable, use; separate from the previous variable values.
4) Start the simulator. (First new emulator in Eclipse, named 1234)
In cmd, enter EMULATOR–AVD 1234
5) After installing apk with ADB, monkey test
ADB install C:\test.apk
Monkey–p Test.apk–v 100
(ADB and Monkey specific parameters are introduced next.) )
Monkey Environment Construction