I'd like to find out various bits of information on an Android device's current status via ADB. Can it be done, and - if so - how?
6 Answers
Try this:
adb shell dumpsys battery
It gives all the battery details.

- 4,942
- 5
- 39
- 54

- 841
- 7
- 11
-
Perfect. Thank you very much. – HomerPlata Feb 16 '17 at 13:06
-
Its ok happy to help :-) – Vineeth Holla Feb 16 '17 at 13:07
-
1For Android Oreo, use `adb shell dumpsys batteryproperties` – Devansh Maurya Apr 07 '19 at 04:06
-
I am not getting battery status ff there are N devices connected. I am running `adb -s
dumpsys battery`. Did anyone get battery status for individual devices? – miltonbhowmick Jun 24 '22 at 10:20 -
I think the `level` field in the output tells the battery status, i.e. `43` when the charge status is 43%. – oferei Jan 07 '23 at 14:22
IF YOUR DEVICE IS ROOTED
You can use ADB almost like a remote shell, so you can get devices battery info using adb shell cat /sys/class/power_supply/battery/batt_attr_text
where "level" is battery level or adb shell dumpsys battery
.
adb shell <your command>
will let you execute almost any linux command. Some commands are not available and must be installed (e.g. busybox).

- 966
- 4
- 18
- 36
-
-
-
2For me, the path was in `/sys/class/power_supply/battery/capacity` – David Refoua Apr 11 '20 at 22:00
Pretty simple and you don't need rooted device for this.
adb shell dumpsys <option>
Subsitute options with any of these: battery diskstats wifi location usagestats cpuinfo iphonesubinfo telephony.registry meminfo netstat package
You may also try adb shell dumpsys | grep "DUMP OF SERVICE"
This will list many other options available with dumpsys.

- 5,763
- 3
- 28
- 37
Dump battery level
adb shell cmd battery get level
To customize the output:
adb shell cmd battery get level | sed 's/.*/Battery:&%/'
Battery:100%
Dump all settings for cmd battery (posix):
batstats="ac usb wireless status level temp present counter invalid"
for batstat in $batstats; do
value=$(adb shell cmd battery get "$batstat")
printf "%-8s: %s\n" "$batstat" "$value"
done
Output:
ac : false
usb : true
wireless : false
status : 5
level : 100
temp : 303
present : true
counter : 4512000
invalid : 0
- Confirmed: android 13/12 - no root reuqired.
Dumpsys:
- equal to cmd
adb shell dumpsys battery get level
For the last command:
However, for your request the following example will do what you asking for:
adb logcat -d -s AODBatteryManager | tac | awk -F' ' '/mRemainingChargeTime/ {
split($15, arr, "=")
gsub(",", "", arr[2])
minutes = int(arr[2] / 60000)
seconds = int((arr[2] % 60000) / 1000)
if (!found) {
print "Estimated time until fully charged: " minutes " min " seconds " seconds"
found=1
exit
}
}'
- Output
Estimated time until fully charged: 31 min 53 seconds
The command retrieves the log messages, reverses them, searches for the line containing "mRemainingChargeTime", extracts the relevant value, calculates the estimated time until fully charged in minutes and seconds, and prints the result. It ensures that only the first match is processed before exiting thats why I included "tac" so we skip the earlier messages since it is printed every ~10 seconds if monitoring the command, for doing that just add adb logcat -c; adb logcat -s ...
and remove the tac and -d from the command:
# Clear old logs
adb logcat -c
# Monitor remaining time
adb logcat -s AODBatteryManager | awk -F' ' '/mRemainingChargeTime/ {
split($15, arr, "=")
gsub(",", "", arr[2])
minutes = int(arr[2] / 60000)
seconds = int((arr[2] % 60000) / 1000)
if (!found) {
print "Estimated time until fully charged: " minutes " min " seconds " seconds"
found=1
exit
}
}'
Time left to full: 29min 29seconds
Time left to full: 29min 22seconds
Time left to full: 29min 11seconds
Time left to full: 29min 4seconds
Time left to full: 28min 57seconds
Time left to full: 28min 46seconds

- 1,259
- 12
- 20