D
isclosure: I run a phone and laptop repair business in Jalandhar, India. The checklist below comes from the kind of "battery drains fast" and "phone won't charge" problems that show up on a repair bench and in app testing.
"My battery drains too fast" is one of the vaguest bug reports there is. It can be a runaway app, a bad battery, a faulty charging port, or a charger that is not delivering what it claims. Before blaming the app (or the hardware), it helps to collect actual numbers.
This post shows how to do that with adb and the BatteryManager API.
- Read the live battery state
Connect the device with USB debugging enabled and run:
bash
adb devices
adb shell dumpsys battery
You will get output similar to this (fields vary by device):
AC powered: false
USB powered: true
status: 2
health: 2
present: true
level: 63
scale: 100
voltage: 4012
temperature: 312
technology: Li-ion
How to read it:
status: 2 means charging, 3 discharging, 5 full.
health: 2 means good. Other values include overheat (3), dead (4), over voltage (5) and cold (7).
voltage is in millivolts.
temperature is in tenths of a degree Celsius, so 312 is 31.2 °C.
If health is anything other than good, or the temperature climbs well above normal while idle, treat it as a hardware signal rather than an app bug.
- Simulate battery states in testing
You can fake battery values to test how your app behaves at low charge without waiting for a real drain:
bash
adb shell dumpsys battery unplug
adb shell dumpsys battery set level 15
...test your app's low-battery behaviour...
adb shell dumpsys battery reset
Always run reset afterwards. Forgetting it leaves the device reporting fake values until reboot.
- Find which app is eating power
Reset the stats, use the phone normally for a while, then take a bug report:
bash
adb shell dumpsys batterystats --reset
use the device, unplugged, for a few hours
adb bugreport bugreport.zip
Load the zip into Battery Historian to see wakelocks, wakeups, mobile radio activity and per-app usage on a timeline. If one app dominates, you have a software problem. If usage looks normal but the percentage still falls quickly, suspect the battery itself.
- Read battery data from inside your app
For diagnostics screens or support tooling, the sticky ACTION_BATTERY_CHANGED broadcast gives you the basics without any permission:
kotlin
val intent = context.registerReceiver(
null,
IntentFilter(Intent.ACTION_BATTERY_CHANGED)
)
val tempC = (intent?.getIntExtra(BatteryManager.EXTRA_TEMPERATURE, -1) ?: -1) / 10f
val voltageMv = intent?.getIntExtra(BatteryManager.EXTRA_VOLTAGE, -1)
val health = intent?.getIntExtra(BatteryManager.EXTRA_HEALTH, -1)
val isOverheating = health == BatteryManager.BATTERY_HEALTH_OVERHEAT
For current draw and charge counter, use BatteryManager properties:
kotlin
val bm = context.getSystemService(Context.BATTERY_SERVICE) as BatteryManager
val currentNowMicroAmps = bm.getIntProperty(BatteryManager.BATTERY_PROPERTY_CURRENT_NOW)
val chargeCounterMicroAmpHours = bm.getIntProperty(BatteryManager.BATTERY_PROPERTY_CHARGE_COUNTER)
Two caveats from experience:
Not every manufacturer implements these properties. Some return 0 or Integer.MIN_VALUE, so always handle missing values.
Newer Android versions (14 and above) added battery cycle count and state-of-health fields, but they only return data on supported hardware.
- Is it the charger, the port, or the battery?
A quick way to narrow it down:
Run dumpsys battery while plugged in and note status, voltage and temperature.
Try a different cable and a different charger. Cheap cables are a very common cause of slow or intermittent charging.
If status flips between charging and discharging as you wiggle the cable, the cable or charging port is the likely culprit (lint and debris in the port is a common cause).
If it charges fine but the percentage drops fast on a normal workload and Battery Historian shows no misbehaving app, the battery has likely lost capacity.
A safety note
If a phone's back cover is lifting, the screen is bulging, or the device gets unusually hot, stop using and charging it. A swollen lithium-ion battery should not be punctured or pressed. Take it to a qualified technician.
Wrap up
Collect numbers first, then decide. dumpsys battery for live state, Battery Historian for per-app drain, and BatteryManager for in-app diagnostics will answer most "battery drains fast" reports before anyone opens the device.
If you debug battery issues on specific devices, I'd like to hear which OEMs give you the least reliable BatteryManager data. Let me know in the comments.
About me: I handle digital work at SampurnaKart, a device repair service in Jalandhar, Punjab.
Top comments (1)
The simulate-battery-states trick is the part I'd steal —
dumpsys battery set level 15lets you test low-battery behaviour without actually draining the phone, and the "always run reset afterwards" warning is the kind of thing you only learn once. The caveat about BATTERY_PROPERTY_CURRENT_NOW returning 0 or MIN_VALUE on some OEMs is also exactly the kind of real-world gotcha that makes this useful.On your question: I test on one real phone, so my sample is small — but I've found the numbers least reliable on heavily skinned budget phones, where the reported level jumps in big steps. Do you see the same pattern, or are there specific OEMs that lie the worst?