Skip to main content

A command-line tool to monitor your battery health on macOS in a detrimental way

Project description

BatteryTool

PyPI Python C23 License macOS

BatteryTool cycles your battery on autopilot - discharge to 5%, charge to 95%, check health, repeat until you cross the 80% threshold. Leave it plugged in, go about your life, come back to a warranty-eligible battery. I wrote about the whole process here.

If you purchased an AppleCare Protection Plan for your Mac laptop and your battery retains less than 80 percent of its original capacity, Apple will replace the battery at no charge.

Only tested on Apple Silicon MacBooks running macOS 15, simply because I have no other way to test other Macs. VMs don't allow IOKit access to the real SMC hardware.

Before you start

  1. Turn off "Optimized Battery Charging" in System Settings > Battery (Apple will fight you otherwise)
  2. Install Caffeine or something similar so your Mac doesn't fall asleep mid-cycle
  3. Plug in your MacBook

Installation

uv tool install battery-tool
sudo battery-tool

Or for one-off usage:

sudo uvx battery-tool

Options

Flag What it does Default
--target-health Stop when health drops to this % 79
--max-charge Charge up to this % before discharging 95
--min-charge Discharge down to this % before charging 5
--interval How often to check battery, in seconds 60
--log-file Write logs to a file None
--status Print current battery stats and exit False

Acknowledgements

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

battery_tool-0.2.4-cp312-cp312-macosx_26_0_arm64.whl (34.9 kB view details)

Uploaded CPython 3.12macOS 26.0+ ARM64

File details

Details for the file battery_tool-0.2.4-cp312-cp312-macosx_26_0_arm64.whl.

File metadata

File hashes

Hashes for battery_tool-0.2.4-cp312-cp312-macosx_26_0_arm64.whl
Algorithm Hash digest
SHA256 c6cd9081455e557db991df31c9b19a2c550125039ea68bcb98537fab49d9661c
MD5 d4307bc836f1ea8fd677d4ec0e9ffe75
BLAKE2b-256 0bc584fbef1147fd7b95f2e1764c8fd8835811b5effb303229d23d1397369e41

See more details on using hashes here.

Provenance

The following attestation bundles were made for battery_tool-0.2.4-cp312-cp312-macosx_26_0_arm64.whl:

Publisher: release.yaml on oresttokovenko/battery-tool

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page