大佬教程收集整理的这篇文章主要介绍了windows上有没有adb等待设备超时方法,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我想使用限时 adb wait-for-device ,但是好像没有超时功能, 我的解决方法如下,有没有更有效的方法来实现它?
<python on @R_403_5087@>
t0 = datetiR_267_11845@e.datetiR_267_11845@e.Now()
cmd = 'date'
cmd = 'adb -s %s sHell \"'+ cmd+ '\"'
r = 1
while(r!=0 and (t1-t0).seconds < 60):
r = os.system(cmd)
t1 = datetiR_267_11845@e.datetiR_267_11845@e.Now()
没有可用的特定超时方法,但您可以尝试
def wait_for_device(self,timeout=5):
"""
Perform `adb wait-for-device` command
Args:
timeout: timE interval in seconds to wait for device
Raises:
DeviceConnectionError: if Device is not available after timeout
Returns:
None
"""
try:
self.cmd("wait-for-device",timeout=timeout)
except RuntimeError as e:
raisefrom(DeviceConnectionError,"device not ready",E)
以上是大佬教程为你收集整理的windows上有没有adb等待设备超时方法全部内容,希望文章能够帮你解决windows上有没有adb等待设备超时方法所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。