You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traceback (most recent call last):
File "uiautomator2-.py", line 100, in <module>
main()
File "uiautomator2-.py", line 27, in main
hig.Log(d.adb_device.battery())
File "D:\Program\Python38win10\lib\site-packages\adbutils\shell.py", line 522, in battery
key, val = line.strip().split(':', 1)
ValueError: not enough values to unpack (expected 2, got 1)
最好能附上可能复现问题的代码。
d = u2.connect('192.168.31.173:5555')
hig.Log(d.device_info)
hig.Log(d.adb_device.battery())
The text was updated successfully, but these errors were encountered:
def dumpbattery():
battery=dict()
r = d.shell("dumpsys battery").output.strip().splitlines()
for lines in r:
if lines.find(": ") > 0:
key, val = lines.split(": ")
if val.lower() in [ "true" ]:
val = True
elif val.lower() in [ "false" ]:
val = False
elif val.isdigit():
val = int(val)
battery[key.replace(" ","").lower()]=val
return battery
{'serial': 'xxx', 'sdk': 25, 'brand': 'SMARTISAN', 'model': 'OD103', 'arch': 'arm64-v8a', 'version': None}
pip show uiautomator2
)The text was updated successfully, but these errors were encountered: