Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Battman the Battery Manager

Torrekie/Battman

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Battman

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

🌍

简体中文

Screenshots

Battman Main Demo Battman Gas Gauge Demo Battman Gas Gauge Demo 2 Battman Adapter Demo Battman Inductive Demo Battman Inductive Demo 2 Battman Serial Demo Battman Temperature Demo Battman Charging Management Demo Battman Charging Limit Demo Battman Thermal 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 Swift and SwiftUI involved
  • NO CocoaPods, NO Swift Packages, NO external code requirements, NO 3rd-party frameworks
  • Compile WITH/WITHOUT Xcode
  • Builds on Linux (Yes, "you need Mac to make iOS apps" is Apple propaganda)
  • 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)
  • Smart Charging (Optimized Battery Charging) communication
  • Low Power Mode behavior control
  • Detailed information for attached MagSafe Accessories
  • Detailed information for attached Lightning Cables & Accessories
  • Read all hardware temperature sensors

Requirements

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

Download

Check latest Release for a prebuilt package.

Or, if you wish to build it by yourself:

# 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
# If Targeting iOS 12 or ealier, download SF-Pro-Display-Regular.otf somewhere, and put it under Battman/
wget <https://LINK/OF/SF-Pro-Display-Regular.otf> -O Battman/SF-Pro-Display-Regular.otf
make -C Battman all
# Produced Battman.ipa will under $(CWD)/Battman/build/Battman.ipa

Known Issues

  • Battman is not actually integrated with hardware when running under devices with A7 to A10, since there has no AppleSMC, instead they uses AppleHPM which we cannot test.

Tested Devices

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

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
  • Bluetooth accessories (AirPods, etc.)

License

MIT for now, may become non-free license 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 the Battery Manager

Resources

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published