1, Monkey Test principle:
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.
2. Monkey Common commands:
adb shell Monkey {+ command argument} times
ADB Shell Monkey-help/-h
3, Analysis:
ADB shell monkey–v–v–v–p package name –s--throttle--ignore-crashes--ignore-timeouts 10000
-V: Used to specify the level of feedback information, that is, the verbosity of the log, with a total of three levels
-P: After the corresponding package name, if it is the whole test, it is not necessary, use this parameter to specify one or more packages (package, app name)
-s:seed value, if the seed value is the same, two random events are the same, commonly used for problem recurrence
--throttle < milliseconds;: Time delay for the specified user (that is, inter-event), in milliseconds
--ignore-crashes--ignore-timeouts: In the monkey test process, encountered the situation of crash or timeout ignored, generally not set, when there is crash or timeout, monkey test will be terminated, Here is to prevent the monkey test from terminating.
10000: Number of random events
4. Terminate the process
ADB shell
PS | grep Monkey
Kill-9 PID
Monkey test Methods