taobao-iphone-device Bug-当设备USB拔掉,_usbmux.Usbmux().device_udid_list()还是会返回拔掉设备的udid

nnsrf1az  于 2022-10-26  发布在  其他
关注(0)|答案(4)|浏览(262)

tidevice版本:0.3.5 @codeskyblue 堆栈如下:
File "F:\GitLab\apprunner\apprunner\device\ios\ios_device.py", line 200, in _install_agent
device = tidevice.Device(self.get_udid())
File "F:\GitLab\apprunner\venv\lib\site-packages\tidevice_device.py", line 86, ininit
self._info = self.info
File "F:\GitLab\apprunner\venv\lib\site-packages\cached_property.py", line 36, inget
value = obj.dict[self.func.name] = self.func(obj)
File "F:\GitLab\apprunner\venv\lib\site-packages\tidevice_device.py", line 115, in info
raise MuxError("Device: {} not ready".format(self._udid))
tidevice.exceptions.MuxError: Device: 60d96bf4160b149ea798f198aeb790c50a5c5df6 not ready

toe95027

toe950271#

@zy02636@codeskyblue@alibaba-oss@373743261

wi3ka0sx

wi3ka0sx2#

  1. device_udid_list 函数无 BUG
  2. 你当前的报错信息是提醒你, 你曾经指定 udid 的设备并不在接入设备列表中
dphi5xsq

dphi5xsq3#

  1. device_udid_list 函数无 BUG
  2. 你当前的报错信息是提醒你, 你曾经指定 udid 的设备并不在接入设备列表中

是因为device_udid_list 返回了该udid,构建tidevice.Device对象时,出现该崩溃堆栈,根本的原因是device_udid_list 就不该给我返回这个已经掉线的设备id

ljo96ir5

ljo96ir54#

taobao-iphone-device/tidevice/_device.py

Lines 94 to 115 in 16c185b

| | @cached_property |
| | definfo(self) ->dict: |
| | """ |
| | Example return: |
| | { |
| | "SerialNumber": "xxxx", # udid |
| | "DeviceID": 12, |
| | } |
| | """ |
| | devices=self._usbmux.device_list() |
| | ifnotself._udid: |
| | assertlen( |
| | devices |
| | ) ==1, "Device is not present or multi devices connected" |
| | _d=devices[0] |
| | self._udid=_d['SerialNumber'] |
| | return_d |
| | else: |
| | fordindevices: |
| | ifd['SerialNumber'] ==self._udid: |
| | returnd |
| | raiseMuxError("Device: {} not ready".format(self._udid)) |

相关问题