# ADB command error
if res.returncode != 0:
logger.error('Get devices list error' + err_str)
return online_devices
lines = [line for line in output.split('\n') if line]
lines.remove("\r") ------------加上后正常
if len(lines) > 1:
for line in lines[1:]:
device = Device.from_adb_line(line)
online_devices[device.device_id] = device
return online_devices
def devices(): res = subprocess.run(f'{adb} devices -l', shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) output = res.stdout.decode() err_str = res.stderr.decode() online_devices = {}