Skip to content

OutrageousStorm/pixel-battery-historian

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ”‹ Pixel Battery Historian

Visualize Android battery drain culprits with beautiful charts β€” powered by ADB dumpsys parsing. No root needed.

Python ADB No Root License: MIT

Google's official Battery Historian requires Docker and a complex setup. This is the lightweight alternative β€” one Python file, one command, beautiful interactive charts.


✨ Features

  • ⚑ 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

πŸ“¦ Requirements


πŸš€ Quick Start

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 --html

This opens a beautiful interactive report showing exactly which apps are killing your battery.


πŸ“Š Report Sections

  • 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

πŸ”§ Usage

# 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

πŸ’‘ Tips

  • 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.

🀝 Contributing

Ideas welcome:

  • Timeline chart of battery level over time
  • Historical comparison between captures
  • Alarm wakeup analysis
  • GPS/sensor usage breakdown

πŸ“œ License

MIT


Inspired by Google's Battery Historian but without the Docker overhead.

About

πŸ”‹ Visualize Android battery drain culprits with beautiful charts β€” powered by ADB bugreport parsing. No root needed.

Topics

Resources

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages