Skip to content

Torrekie/Battman

Repository files navigation

Battman

Strayers' modern battery manager for their good old iOS devices.

🌍

简体中文

Screenshots

Battman Main Demo Battman Gas Gauge Demo Battman Adapter Demo

$${\color{grey}True \space elegance \space in \space software \space lies \space in \space the \space art \space of \space its \space code \space rather \space than \space in \space superficial \space design.}$$


Advantages

  • Purely constructed with Objective-C & C
  • UI purely written with brilliant Objective-C codes
  • NO StoryBoards, NO additional binaries, NO Xcode Assets
  • NO nasty Swift and SwiftUI involved
  • NEITHER Swift NOR SwiftUI involved, they are disgusting
  • NO CocoaPods, NO Swift Packages, NO external code requirements, NO 3rd-party frameworks
  • Compile WITH/WITHOUT Xcode
  • Obtain & Operate directly from/with your hardware with the deepest raw data
  • Supporting iPhone & iPad & iPod & Xcode Simulator & Apple Silicon Macs (If someone donate devices I can even code for Apple Watches and Apple TVs)
  • Highly integrated with your battery Gas Gauge IC that manufactured by Texas Instruments
  • Show as much as power informations than IOPS & PowerManagement provided
  • Identifying your power adapters, wireless chargers, or even your MagSafe accessories

Only Battman Can Do

What other battery utils made for iOS hasn’t done (As of 9th Sun Mar 2025 UTC+0)

  • Complete NotChargingReason decoding (see not_charging_reason.h)
  • Texas Intruments Impedance Track™ information retrieving
  • Real-time charging current/voltage reading
  • Running perfectly when in Xcode Simulator (Other people uses IOPS in their app so not working in Sims)

Requirements

  • Jailbroken or install with TrollStore
  • iOS 13+ / macOS 11+ (backports welcomed)
  • arm64 (A7+ theoretically / M1+)
  • Gettext libintl (Optional, for localizations)
  • GTK+ 3 (Optional, for running under GTK+ based WM)

Download

I don't provide prebuilts at current stage, Battman is still not as completed as how I thought. If you really desired to use Battman, build by yourself or contact me for a prebuilt package.

# On macOS, install Xcode and directly build in it
# On Linux or BSD, make sure a LLVM cross toolchain and iPhoneOS.sdk is prepared, modify Battman/Makefile if needed
# On iOS, when you using Torrekie/Comdartiwerk as bootstrap
apt install git odcctools bash clang make sed grep ld64 ldid libintl-dev iphoneos.sdk
git clone https://github.com/Torrekie/Battman
cd Battman
make -C Battman all
# Produced Battman.ipa will under $(CWD)/Battman/build/Battman.ipa

Tested Devices

  • iPhone 12 Series (D52)
  • iPad Pro 2021 3th Gen (J51)

Please file issues if Battman not working correctly on your device

TODO

  • AppKit/Cocoa UI for macOS
  • GTK+/X11 UI for iOS/macOS
  • Auto identify Gas Gauge IC
  • Optional data collection (For decoding currently unknown params)
  • Advanced features (AppleSMC/ApplePMGR interface)
  • Thermal control
  • Run as CLI
  • Run as daemon
  • Charge limit
  • Wireless/MagSafe integration
  • App rate limit
  • Jetsam control
  • Fan control

License

MIT for now, may become non-free later (at least MIT for now), you won't blame me if I want to make living with this right?

Disclaimer

DO NOT USE FOR PRODUCTION, NO WARRANTY GURARANTEED, USE AT YOUR OWN RISK.

About

Battman

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published