Battery 电池信息查询与设置

1. 电池信息查询

adb shell dumpsys battery

Current Battery Service state:
  AC powered: false
  USB powered: true
  Wireless powered: false
  Max charging current: 0
  Max charging voltage: 0
  Charge counter: 0
  status: 2
  health: 2
  present: true
  level: 100
  scale: 100
  voltage: 4395
  temperature: 320
  technology: Li-ion

2. 模拟电池断开充电(Android 6.0以上)

adb shell dumpsys battery unplug

3. 模拟电池为非充电状态

adb shell dumpsys battery set status 1

4. 模拟电池电量

adb shell dumpsys battery set level 100

我经常使用

adb shell dumpsys battery unplug
adb shell dumpsys battery set status 0
adb shell dumpsys battery set level 100

猜你喜欢

转载自blog.csdn.net/su749520/article/details/80811124