Skip to content

About

Android battery telemetry and idle drain diagnostics tool.

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

PowerTrace Logo

Android battery telemetry and idle drain diagnostics tool.

Platform Kotlin Jetpack Compose License Latest APK


Overview

PowerTrace helps you find out what is actually draining your device's battery while the screen is off.

Standard Android battery menus only show coarse, aggregated percentages. PowerTrace takes snapshots of Android's internal diagnostic sources (batterystats, dumpsys alarm, dumpsys power, and device power profiles) to break down battery loss across custom recording sessions—without requiring root access.

Download

Get the latest build directly from GitHub:

Key Features

  • Session Recording: Start a diagnostic session (e.g., overnight or during standby) and calculate deltas between baseline and completion.
  • Wakeup & Culprit Detection: Pinpoints apps and processes causing excessive alarms, wakeups, partial wakelocks, and background CPU time.
  • Power Profile Attribution: Estimates energy use (mAh) based on your device's OEM power profile hardware coefficients.
  • Auto-Stop Triggers: Optionally end sessions automatically when you unlock the device or plug it into a charger.
  • Continuous Monitoring: An optional background service to track periodic intervals throughout the day.
  • Charger & Cable Benchmarking: Measure real-time charging wattage, voltage, current, and thermal curves. Catalog your power bricks and USB cables separately to compare combinations and spot bottlenecked cables. Smart post-unplug notification prompts you to tag and save sessions.
  • Diagnostics Export: Export session snapshots as JSON or raw diagnostic checkins for debugging and bug reports.
  • Mock Diagnostic Mode: Includes a built-in mock telemetry source so developers can inspect and test the UI without configuring ADB permissions.

Setup & ADB Permissions

PowerTrace reads protected system stats that are not exposed to normal third-party apps by default. These can be granted once via ADB without rooting:

adb shell pm grant com.antigravity.battery android.permission.BATTERY_STATS
adb shell pm grant com.antigravity.battery android.permission.DUMP
adb shell pm grant com.antigravity.battery android.permission.PACKAGE_USAGE_STATS
adb shell pm grant com.antigravity.battery android.permission.INTERACT_ACROSS_USERS
adb shell appops set com.antigravity.battery GET_USAGE_STATS allow

Note: If you don't have ADB available, you can toggle Mock Diagnostic Mode in the app settings to test all features with simulated data.

Tech Stack

  • UI: Jetpack Compose, Material 3
  • Language: Kotlin (Coroutines, Flow)
  • Architecture: MVVM with unidirectional data flow
  • Storage: Room SQLite database
  • Target SDK: Android 14 (API 34) / Min SDK 26

Building

Clone the repository and build with Gradle:

git clone https://github.com/SneakyZippy/PowerTrace.git
cd PowerTrace
./gradlew assembleDebug

You can then install the debug build directly to a connected device:

./gradlew installDebug

License

This project is licensed under the terms of the GNU General Public License v3.0 (GPL-3.0).

About

Android battery telemetry and idle drain diagnostics tool.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages