Monkey Relatively simple, I have also written an article about sending instructions to the specified app to do automated pressure measurement
Try.
So what if we don't want to send instructions in batches and do thousands of scripts that we write?
Let us introduce the script file method written on the PC:
650) this.width=650; "Src=" https://s5.51cto.com/wyfs02/M02/98/55/wKioL1k6QYeAA0PjAACVBcdpn5E317.png-wh_500x0-wm_ 3-wmp_4-s_3274201374.png "title=" script. png "alt=" wkiol1k6qyeaa0pjaacvbcdpn5e317.png-wh_50 "/>
Here are some random scripts to write your own scripts according to your needs.
650) this.width=650; "Src=" https://s2.51cto.com/wyfs02/M00/98/55/wKioL1k6QZLCtN43AAAobLTwcW8362.png-wh_500x0-wm_ 3-wmp_4-s_3483675465.png "title=" verifies whether the device is linked. png "alt=" wkiol1k6qzlctn43aaaobltwcw8362.png-wh_50 "/>
If the result is empty, or if the offline requires reseating the device or the process of 5037 Port is killed,
Before you connect the device.
upload file Directive adb push d:\monkey_script.txt/sdcard/
There are spaces between the above instruction words.
650) this.width=650; "Src=" https://s4.51cto.com/wyfs02/M00/98/55/wKiom1k6QZ2gEgFMAAAnRmOj3GQ423.png-wh_500x0-wm_ 3-wmp_4-s_3019749025.png "title=" upload file. png "alt=" wkiom1k6qz2gegfmaaanrmoj3gq423.png-wh_50 "/>
This screen shows that the upload was successful. We can also check if there are any files that we have uploaded under this path.
ADB shell enters the phone
then execute cd/sdcard/
See the files that pass
650) this.width=650; "Src=" https://s2.51cto.com/wyfs02/M01/98/55/wKiom1k6QaiTdhyGAAAfzXdzlSs133.png-wh_500x0-wm_ 3-wmp_4-s_3446503761.png "title=" SDcard directory. png "alt=" wkiom1k6qaitdhygaaafzxdzlss133.png-wh_50 "/>
Execute script file directive:adb shell monkey–v 100–f/sdcard/monkey_script.txt
-V is the number of executions that must be written, otherwise it will not execute.
-F is the file to be executed
The log will be printed in real-time after execution, and the phone will be automatically operated
650) this.width=650; "Src=" https://s3.51cto.com/wyfs02/M01/98/55/wKioL1k6QbXhv05VAAG9uYcwBBU087.png-wh_500x0-wm_ 3-wmp_4-s_1630529203.png "title=" execution complete log.png "alt=" Wkiol1k6qbxhv05vaag9uycwbbu087.png-wh_50 "/>
This is the real-time log.
If you have a problem, you can communicate. QQ Group: 610845268
This article is from the "It Bug" blog, so be sure to keep this source http://laomomo.blog.51cto.com/6595318/1933794
android--to execute script files on the PC via monkey on the phone