时间:2021-07-01 10:21:17 帮助过:113人阅读
monkeyrunner fling.py
查看 android monitor 内存也都释放掉了
测试代码如下
代码如下 fling.py
#!/usr/bin/env monkeyrunner import time from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice device = MonkeyRunner.waitForConnection(5) # fling up def scrollUpFling(): device.touch(100, 500, MonkeyDevice.DOWN) device.touch(100, 100, MonkeyDevice.MOVE) device.touch(100, 100, MonkeyDevice.UP) print "fling up" # fling down def scrollDownFling(): device.touch(100, 400, MonkeyDevice.DOWN) device.touch(100, 500, MonkeyDevice.MOVE) device.touch(100, 500, MonkeyDevice.UP) print "fling down" def fling(): for i in range(1,1000): scrollUpFling() time.sleep(0.1) scrollDownFling() time.sleep(0.1) fling()
以上就是利用Monkey命令操作屏幕快速滑动 的详细内容,更多请关注Gxl网其它相关文章!