Visualize Android battery drain culprits with beautiful charts β powered by ADB
dumpsysparsing. No root needed.
Google's official Battery Historian requires Docker and a complex setup. This is the lightweight alternative β one Python file, one command, beautiful interactive charts.
- β‘ Wakelock analysis β which apps are waking up your CPU and draining battery
- πΆ Network usage β which apps are constantly phoning home
- π Interactive charts β built with Chart.js, dark theme
- π Standalone HTML report β share it, open it offline
- π Reset & measure β reset stats, use phone, capture results
- β‘ No root, no Docker, no server β pure ADB + Python
- Python 3.7+
- ADB (Android Platform Tools)
- USB Debugging enabled on your Android device
git clone https://github.com/OutrageousStorm/pixel-battery-historian
cd pixel-battery-historian
# Connect phone via USB, enable USB Debugging, then:
# Step 1: Reset the stats (start fresh)
python battery_historian.py --reset
# Step 2: Use your phone normally for a while (30 min - few hours)
# Step 3: Capture and visualize
python battery_historian.py --htmlThis opens a beautiful interactive report showing exactly which apps are killing your battery.
- Stats overview β total tracked time, CPU active time, app counts
- Top Wakelock Holders β apps that prevent the CPU from sleeping (bar chart)
- Top Network Users β apps consuming mobile/WiFi data (stacked bar chart)
- Wakelock Detail Table β full list with visual impact bars
- Network Detail Table β upload/download breakdown per app
# Capture from connected device, generate HTML
python battery_historian.py --html
# Specify output file
python battery_historian.py --html --output my_report.html
# Target specific device (if multiple connected)
python battery_historian.py --device R3CN80XXXXX
# Reset battery stats counter
python battery_historian.py --reset- For the most accurate results, reset stats, charge to 100%, then use your phone unplugged for several hours before capturing.
- Wakelocks are the #1 battery drain cause β any app holding a wakelock prevents your CPU from deep sleeping.
- Background network activity on apps you rarely open is a red flag.
Ideas welcome:
- Timeline chart of battery level over time
- Historical comparison between captures
- Alarm wakeup analysis
- GPS/sensor usage breakdown
MIT
Inspired by Google's Battery Historian but without the Docker overhead.