Controlling battery charging on Apple Silicon Macs is notoriously opaque. macOS offers “Optimized Battery Charging,” which uses machine learning to decide when to top off your charge. But what if you want explicit, user-controlled charge thresholds? The battery project steps into this gap with a straightforward Shell-based utility that manipulates the System Management Controller (SMC) registers on Apple Silicon Macs, giving you precise control over charging behavior.
controlling apple silicon mac battery charging via smc register writes
At its core, battery is a Shell script wrapper around a precompiled smc binary that directly writes to the SMC registers responsible for battery charge management on Apple Silicon Macs. The smc tool itself is a fork from the smcFanControl repository, repurposed here to set charging thresholds rather than fan speeds.
The project ships two main interfaces: an Electron-based tray GUI app for convenient status and toggling, and a standalone command-line interface (CLI) that exposes granular controls. With the CLI, you can set a single charge threshold (e.g., maintain 80%), a range (e.g., maintain between 70% and 80%), manually toggle charging or discharging, or even run a full calibration cycle.
Under the hood, the charging limits are enforced at the hardware level via SMC register writes. This means the limits persist even when the app is closed or the system is rebooted. Unlike macOS’s built-in solution, which relies on machine learning predictions and is opaque to the user, battery offers explicit, deterministic control.
The project supports Apple Silicon Macs only; Intel Macs are not compatible due to differences in hardware and SMC implementations.
the technical strength: hardware-level control without kernel extensions
What distinguishes battery is its minimalistic yet effective approach to controlling battery charging. It avoids complex kernel extensions, signed drivers, or private APIs. Instead, it leverages a precompiled SMC binary to write values directly to system management registers from userspace.
This design has clear tradeoffs:
Simplicity and safety: No kernel-level code means fewer risks of system instability or security flags from macOS. The codebase itself is a modest ~200 lines of Shell script orchestrating calls to the
smcbinary.Persistence: Since the SMC enforces the limits at the hardware level, the charging threshold survives reboots and app restarts, a practical advantage over purely software-level approaches.
Granularity: The CLI allows setting precise thresholds, including ranges and calibration cycles, which is more flexible than macOS’s all-or-nothing Optimized Charging.
Open source and transparency: Users can inspect and modify the Shell script, understanding exactly what’s going on under the hood.
However, there are limitations:
Apple Silicon only: The approach depends on specific SMC registers present on Apple Silicon Macs, so Intel Macs are out of scope.
No dynamic ML-based adjustments: Unlike macOS’s Optimized Charging, battery does not predict your usage patterns. You set static thresholds manually.
Requires admin permissions: Writing to SMC registers needs elevated privileges, so the app prompts for your administrator password on first run.
Dependence on precompiled binary: The
smctool is a precompiled binary forked from smcFanControl, which means users must trust this binary or build it themselves.
Overall, the code is surprisingly clean and focused, trading off complex heuristics for direct control.
quick start with battery on apple silicon mac
Requirements
This is an app for Apple Silicon Macs. It will not work on Intel macs. Do you have an older Mac? Consider the free version of the Al Dente software package. It is a good alternative and has a premium version with many more features.
Installation
- Option 1: install the app through brew with
brew install battery - Option 2: download the app dmg version here
- Option 3: install ONLY the command line interface (see section below)
When installing via brew or dmg, opening the macOS app is required to complete the installation.
The first time you open the app, it will ask for your administator password so it can install the needed components. Please note that the app:
- Discharges your battery until it reaches 80%, even when plugged in
- Disables charging when your battery is above 80% charged
- Enables charging when your battery is under 80% charged
- Keeps the limit engaged even after rebooting
- Keeps the limit engaged even after closing the tray app
- Also automatically installs the
batterycommand line tool. If you want a custom charging percentage, the CLI is the only way to do that.
Do you have questions, comments, or feature requests? Open an issue here or Tweet at me.
Installation
One-line installation:
curl -s https://raw.githubusercontent.com/actuallymentor/battery/main/setup.sh | bash
This will:
- Download the precompiled
smctool in this repo (built from the hholtmann/smcFanControl repository) - Install
smcto/usr/local/bin - Install
batteryto/usr/local/bin
verdict: a practical tool for apple silicon power users who want explicit battery control
Battery fills a niche for Apple Silicon Mac users who want direct, explicit control over their charging thresholds without relying on macOS’s opaque ML-driven system. Its hardware-level enforcement and persistence across reboots make it a practical choice for power users and those aiming to extend battery longevity by avoiding constant 100% charging.
The tradeoff is that it requires admin rights and does not offer dynamic adjustments based on usage patterns. Also, since it depends on a precompiled smc binary, some users might hesitate to fully trust it without building the binary themselves.
If you want a no-fuss, transparent way to set and maintain battery charge limits on Apple Silicon Macs, this project is worth exploring. The combination of a lightweight Shell script and a focused CLI — backed by a simple Electron GUI — delivers an approachable yet effective solution.
→ GitHub Repo: actuallymentor/battery ⭐ 6,984 · Shell