alibaba / tidevice

tidevice can be used to communicate with iPhone device
MIT License
2.42k stars 456 forks source link

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

Open linmscat opened 3 years ago

linmscat commented 3 years ago

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, in init self._info = self.info File "F:\GitLab\apprunner\venv\lib\site-packages\cached_property.py", line 36, in get 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

linmscat commented 3 years ago

@zy02636 @codeskyblue @alibaba-oss @373743261

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

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

electricbubble commented 3 years ago

https://github.com/alibaba/taobao-iphone-device/blob/16c185b90fd499747e9f97e1a4ea4977f0916d0f/tidevice/_device.py#L94-L115