文章源自陈学虎-https://chenxuehu.com/article/2017/04/6342.html
monkeyrunner 安装应用,卸载应用,截图功能实例代码。文章源自陈学虎-https://chenxuehu.com/article/2017/04/6342.html
文章源自陈学虎-https://chenxuehu.com/article/2017/04/6342.html
from com.android.monkeyrunner import MonkeyRunner,MonkeyDevice device=MonkeyRunner.waitForConnection() if not device: print "Please connect a device to start!" else: print "Start " i = 1 while i<100: print ('this is the ' + str(i) + ' time do action') device.installPackage('D:\\APK\\com_qiyi_video_pad_80613.apk') print ('install success') device.startActivity(component="com.qiyi.video.pad/com.qiyi.video.pad.WelcomeActivity") print ('start success') MonkeyRunner.sleep(5) resultt=device.takeSnapshot() resultt.writeToFile('d:\\test\\tmain_qiyi.png','png') print ('picture success') MonkeyRunner.sleep(5) device.removePackage ('com.qiyi.video.pad'); print ('remove success') i=i+1
文章源自陈学虎-https://chenxuehu.com/article/2017/04/6342.html
文章源自陈学虎-https://chenxuehu.com/article/2017/04/6342.html
文章源自陈学虎-https://chenxuehu.com/article/2017/04/6342.html 文章源自陈学虎-https://chenxuehu.com/article/2017/04/6342.html
评论