现在做个项目是Andriod平台的,正好练习下自动卸载安装测试。
from com.android.monkeyrunner import MonkeyRunner,MonkeyDevice,MonkeyImage
device = MonkeyRunner.waitForConnection()
device.removePackage('com.ifoer.expedition.crp229')
print "uninstall successfully"
device.installPackage('D:/229/CRP229.apk')
print "install successfully"
package = 'com.ifoer.expedition.crp229'
activity = 'com.ifoer.pro.expeditionphone.GuideActivity'
runComponent = package + '/' + activity
device.startActivity(component=runComponent)
MonkeyRunner.sleep(5)
for i in range(4):
device.drag((600,200),(100,200),0.5,4)
device.touch(204,367,'DOWN_AND_UP')
device.touch(558,366,'DOWN_AND_UP')