1.1 命令:
adb shell dumpsys battery
示例:
adb shell dumpsys battery
Current Battery Service state:
AC powered: false
USB powered: true
Wireless powered: false
Max charging current: 500000
status: 2
health: 2
present: true
level: 100
scale: 100
voltage: 4414
temperature: 310
technology: Li-poly
这将返回当前设备有关电池的所有信息。
1.2 参数说明
Current Battery Service state | 当前电池服务状态 |
AC powered: false | 交流供电 |
USB powered: true | USB供电 |
Wireless powered: false | 无线供电 |
Max charging current: 500000 | 最大充电电流 |
Max charging voltage: 4713000 | 最大充电电压 |
status: 2 | 电池状态: 2:正充电;3:没插充电器;4:不充电; 5:电池充满 |
health: 2 | 电池健康状态:2:良好; 3:过热; 4:无用的; 5:超压; 7:温度过低 |
present: true | 电池是否安装在机身 |
level: 82 | 电量: 百分比 |
voltage: 4500 | 电池电压 |
temperature: 378 | 电池温度,单位是0.1摄氏度 |
technology: Li-ion | 电池种类 |
1、dumpsys battery set wireless 电池是否无线供电 0-false 1-true
2、dumpsys battery set level 电池电量百分比 0-100
3、dumpsys battery set status 电池状态:2:正充电;3:没插充电器;4:不充电
4、dumpsys battery set temp 电池温度
5、dumpsys battery set voltage 电池电压
6、dumpsys battery set ac 电池是否电源充电 0-无线充电 1-交流充电
7、dumpsys battery set usb 电池是否USB供电 0-false 1-true
命令使用示例:
dumpsys battery set usb 1
adb shell dumpsys battery reset