There are two common types of errors for Android
1.ANR type
1) No response input events within 5 seconds (for example, press the button, touch the screen)
2) Broadcastreceiver not executed within 10 seconds
2.Crash type
1) Abnormal stop
2) Abnormal exit
Monkey Debug Parameters
--kill-process-after-error hesitate an error while stopping, the application that went wrong will continue to be in the running state
--wait-dbg start Monkey, interrupt its operation, wait for the debugger to attach
Command Demo
adb shell monkey-p com.dabai.app.im--pct-majornav--ignore-crashes--ignore-timeouts--throttle 200-v-V 100 (Ignore an R with crash error type, run all the Times)
Monkey Black and white list
Blacklist: Apps that are not tested
Whitelist: Test only this part of the application (as in the previous section, the role of-p) but if you have too many programs for-p, you need a whitelist.
Note that the blacklist and whitelist can only be set one and cannot be used at the same time.
Parameters
--pkg-blacklist-file followed by the path to the file.
--pkg-whitelist-file followed by the path to the file.
Path saved in/data/local/tmp/
Command Demo
Test machine Application
First find out what the application of the machine
ADB shell PM List Packages > d:\pkg.txt
The machine application is generated to the D drive, named Pkg txt document, can be viewed on the PC after the completion of execution
The exported content is the app package mentioned in the previous section, as shown in
If you want to add the app to the blacklist and not execute the app, create a new TXT document and add the app APK package name that you don't need to execute.
Small seven put the following several applications that do not need to be executed in the D drive, named Blacklist.txt
Then push the file in the cmd command.
ADB push d:\blacklist.txt/data/local/tmp/if push succeeds
And then test the whole thing now.
ADB shell Monkey--pkg-blacklist-file/data/local/tmp/blacklist.txt--throttle 200 300
This command means to not run the blacklist application, delay 200 milliseconds to execute 300 times
Below to run the whitelist app
First create a new TXT document to save the application to run in, named Whitelist.txt, the same is the cmd command to push the file to the phone
ADB push d:\whitelist.txt/data/local/tmp/
And then test the whole thing now.
ADB shell Monkey--pkg-whitelist-file/data/local/tmp/whitelist.txt--throttle 200 300
This command means only running the whitelist application, delaying the execution 300 times in 200 milliseconds
Android automated stress test Monkey Test Android common error types and how to use black and white list (iv)