Battery Draining After You Install an APK? Five Causes and How to Tell Them Apart
A sideloaded app that halves your standby time is not a vague 'bad optimisation' problem. Diagnose it as a wake lock, background location, alarm storms, a crash loop, or a hostile app — with dumpsys and logcat commands for each.
You install an APK from outside the Play Store. Next morning the phone has lost 25% overnight instead of the usual 3%. The easy conclusion — "sideloaded apps drain batteries" — is wrong in a way that matters. It's a specific behaviour that drains the battery, not the install channel. The same APK installed from Play would drain just as much.
The useful move is classifying the drain into one of five causes, because each has a different test and a different fix.
Step zero: measure a baseline
Feelings are not data. Start with the built-in report: Settings → Battery → Battery usage.
Look at two numbers per app:
- Foreground vs background time. Background time far exceeding real usage is almost always a wake-up problem.
- Network usage. Abnormal drain usually comes with steady uplink traffic — heartbeats, telemetry, ad requests.
Watch two full charge cycles before concluding anything. Single-cycle readings swing wildly.
For something more precise, use adb (enable Developer options → USB debugging):
# per-app attribution with estimated mAh
adb shell dumpsys batterystats --charged com.example.app | head -60
# who is preventing the device from idling
adb shell dumpsys deviceidle | head -40The full dump is enormous; filter by package first, then read the Wake lock, Mobile radio active, and Sensor sections.
Cause 1: an unreleased wake lock
The app holds a PARTIAL_WAKE_LOCK to run a background sync and forgets to call release(). The CPU never sleeps.
adb shell dumpsys power | grep -A3 "Wake Locks"Fix: you cannot patch the app, but you can contain it — Settings → Apps → the app → Battery → Restricted. Android then force-stops it after a period in the background. Caveat: restricted mode delays or kills push notifications. For messaging apps, use cause 3's method instead.
Cause 2: background location and sensors
Common with maps, fitness, and delivery apps. The tell is that drain spikes while moving or outdoors and normalises when stationary indoors.
adb shell dumpsys location | grep -i "client\|request" | head -20Fix: change location permission from "Allow all the time" to "Allow only while using the app." This single change typically removes half the abnormal drain and rarely breaks core functionality.
Cause 3: alarm storms
Apps schedule syncs with AlarmManager. An interval set to one minute means wake, spin up the process, connect, sleep — continuously.
adb shell dumpsys alarm | grep -B2 -A6 "com.example.app"Look for RTC_WAKEUP entries and their intervals. A third-party app waking the device more often than every 15 minutes is far outside normal.
Fix: stretch the interval at the system level (some ROMs expose "background network restrictions" or "autostart management"), or reduce the app's real-time requirement.
Cause 4: a crash loop
The most invisible cause. The app starts in the background, crashes immediately, the system restarts it, it crashes again. Nothing is visible on screen, but the CPU is never idle.
adb logcat -b crash -d | grep -i "com.example.app" | tail -30Fix: this is usually a compatibility or packaging problem, not a battery problem:
- ABI mismatch — a universal package can load the wrong native library on older devices; the correct
arm64-v8asplit is often more stable. - Missing split — installing only the base APK from a bundle leaves
UnsatisfiedLinkErrorat launch. - Signature mismatch — installing the same app from two different sources leaves stale data directories that crash on start.
Uninstall cleanly and reinstall the matching build. To read ABI, minSdk, and density requirements first, see Android APK compatibility check.
Cause 5: the source itself is the problem
This is not poor optimisation, it is hostile behaviour: constant background uploads, ad fetches, silent pushes of promoted packages.
Signal: standby drain is normal, but battery falls fast the moment the screen is on; network stats show more upload than download.
Fix: stop tuning battery settings and uninstall. An unknown-origin APK making frequent outbound connections is a security signal first — the battery is just the symptom you noticed.
Order of operations
- Downgrade location permission to "while in use" — five seconds, highest hit rate.
- Set the app to Restricted — tests whether it really is a background wake-up problem.
- Disable autostart / background data for that app.
- Still abnormal? Check
adb logcat -b crashfor a crash loop; if found, uninstall and install the correct build. - All of the above fails and there's unexplained traffic → uninstall and re-acquire from a trusted source.
Counter-intuitive note
"Turn off battery optimisation" gets prescribed as a universal fix, but it addresses notification latency, not drain. Setting a chatty app to Unrestricted so its push arrives instantly will make your battery worse, not better. Identify the cause class first — which is why the baseline measurement in step zero isn't optional.
Most of this work disappears if you verify the package before installing: hash, signature, and the permission list. See APK signature verification guide for the checks worth doing every time.