openatx / adbutils

pure python adb library for google adb service.
MIT License
780 stars 180 forks source link

adb.device_list()获取不到serial,使用os.popen('adb shell').read()可以获取到serial #61

Closed fromzhou closed 1 year ago

fromzhou commented 2 years ago

您好! 请问,使用adb.device_list()获取不到serial 反而使用os.popen("adb devices").read(),可以获取,这是什么原因导致的呢 image

abeelan commented 2 years ago

找一个在线设备试试呢? adb.devices_list() 有可能过滤了 offline 状态的设备。

codeskyblue commented 2 years ago

@abeelan 是的offline的被过滤掉了

codeskyblue commented 1 year ago

Use method list will see offline device

import adbutils

adb = adbutils.AdbClient(host="127.0.0.1", port=5037)
for info in adb.list():
    print(info.serial, info.state)
    # <serial> <device|offline>