Is it possible to fetch current battery level via ADB shell command?

1.9k Views Asked by At

Suppose If change the battery level to any desired value(say from current 50 to 20)

adb shell dumpsys battery set level 20

Now I want adb command to fetch the current battery level(ie 20).

With the below command I can reset to original value(50 in our example)

adb shell dumpsys battery reset

Now again I want fetch the current current charge level via adb command

1

There are 1 best solutions below

7
Pietrek On BEST ANSWER

For linux/macOS:

 adb shell dumpsys battery | grep level

For Windows:

adb shell dumpsys battery | findstr /r /c:level