用户可以通过adb shell dumpsys battery 获取当前电池信息:
AC powered: false
USB powered: true
Wireless powered: false
Max charging current: 500000 # 最大充电电流
Max charging voltage: 5000000 #最大充电电压
Charge counter: 1973820 #
status: 2 #电池状态:2:充电状态 ,其他数字为非充电状态
health: 2 #电池健康状态:只有数字2表示good
present: true #电池是否安装在机身
level: 67 #当前电量百分比
scale: 100 #最大电量百分比
voltage: 4066 #当前电压
temperature: 330 #当前温度,单位为0.1摄氏度
technology: Li-ion #电池类型
adb shell dumpsys battery -h
改变手机充电状态
adb shell dumpsys battery set status 1 #手机不充电
adb shell dumpsys battery set status 2#充电