|
回复 1# wangfuwen
楼主, 你的代码OK 着,可以实现的,应该是你的设备 S/N 序号有问题。
#######################
#######################
import os
import re
from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice, MonkeyImage
def device_reboot(deviceId):
reboot = "adb -s " + deviceId +" reboot recovery"
os.system(reboot)
MonkeyRunner.sleep(60)
i = 5
while i > 0:
find_device = "adb devices"
popen = os.popen4(find_device)
result = popen[1].read()
result_value = re.findall(deviceId,str(result))
if(deviceId == result_value[0]):
break
i = i - 1
device_reboot('Yvan')
device= MonkeyRunner.waitForConnection()
device.drag((100, 100), (400, 400), 1.0, 5) |
|