无法在设备之间循环

2024-09-26 18:18:08 发布

您现在位置:Python中文网/ 问答频道 /正文

我正试图使用this library,但由于出现错误LIBUSB_ERROR_TIMEOUT,我无法访问所有设备

这是我的密码:

cmd = 'echo hello world'
for connectedDevice in adb_commands.AdbCommands.Devices() :
    device = adb_commands.AdbCommands()
    device.ConnectDevice(port_path=connectedDevice.port_path, rsa_keys=[self.signer])
    print device.Shell(command=cmd).strip()
    device.Close()

我只能对generator对象中的第一个设备运行命令,当循环到达第二个设备时,它会失败,并出现上述错误。你知道吗

有办法解决吗?你知道吗


Tags: pathcmdportdevice错误librarytimeouterror

热门问题