1. First install adb
Address: http://www.downza.cn/soft/219906.html
install to D drive, during the installation process, be careful not to install the whole family bucket.
Find this compressed package:
unzip it to the current folder:
2. Write the address of adb into the environment variable of the system
The D:\adb here depends on the individual, as long as your folder is opened with the following four files.
After completing this step, open cmd, enter the command adb, and display the version number, indicating that the installation is successful.
3. Get the device number (leave the phone in developer mode and enable USB debugging)
If you download version 1.0.26 as described in step 2 above, you may not be able to successfully obtain the device number under win10.
Update the version to solve the problem, address: https://adbshell.com/downloads , replace the three files in the compressed package with the three files with the same name in D:/adb
cmd try again, the version becomes 1.0.41:
This version can successfully obtain the device number.
Four. Start using
cmd input command: adb shell pm list packages to view the package names installed in the phone
Enter the command:
adb shell monkey -p XXXXXXXXXX --pct-touch 20 --pct-motion 20 --pct-trackball 20 --pct-appswitch 5 --pct-nav 5 --pct-majornav 10 --pct-anyevent 20 --ignore-crashes --ignore-timeouts --ignore-security-exceptions -v 10000 >F:/log/monkeylog2020.txt
can run automatically. Note that XXXXXXXXXX here is the package name, just follow the picture above. Just pick one.
Here, the command line will perform automated operations while running on the phone, and at the same time generate logs in F:/log/monkeylog2020.txt
Five. Simple analysis log
Monkey runs very fast, mainly for us to troubleshoot abnormalities and crashes
. Search for keywords in the txt log:
1.ANR: represents the program is not responding
2.crash: represents the crash
3.Exception: represents other problems
If you find the follow-up processing steps of the above event:
1. Find out where the error is in the monkey
2. Check some event actions in the monkey before the error, and perform the action manually
3. If the above steps cannot be found, you can use the previous Execute the executed monkey command again, paying attention to the same seed value
6. Wireless connection
1. The device number must be obtained when
USB is connected . 2. Enter the command: adb tcpip 5555, and then unplug the USB cable
3. Find the IP address of the phone
4. Enter the command: adb connect 192.168.1.6:5555, the connection is successful