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?
Show battery percentage in status barOpen your phone's Settings app. Tap Battery. Turn on Battery percentage.
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 .
Go to settings > Battery and device care > Diagnostics. You can now tap on battery status to check its health status. There are other features as well (Camera, speaker and more) of the phone that you can test to see if they are working fine or you should get them fixed.
You can verify that your device is connected by executing adb devices from the android_sdk /platform-tools/ directory. If connected, you'll see the device name listed as a "device."
Try this: adb shell dumpsys battery
It gives all the battery details.
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).
Source
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With