There are currently apps in the app-store (so it does not require jailbreak) that tell you :
Exact percentage value of battery level you have on your iPhone. I have tried Apple's official Code Sample, although it tells you when your iPhone is charging and discharging but it gives me values in 5% steps. How do these apps get exact values of battery percentage?
Applications like Battery Health show
- Current Maximum Capacity vs Manufacturer's Capacity
- Current Discharge Rate
- Lifetime Battery Cycle Count
The same application also gives information about the Charging Rate in Watts when the phone is charging (check images) and current Charger's Power Rating.
How do these applications get so much detail about battery health when [UIDevice] provides so little information about it and almost no information on battery health and performance.
I've developed a solution that will allow you to obtain this information without invoking any private API calls (though I certainly couldn't promise you Apple would approve it).
While the information in question does originate from IOKit, I've found a way of getting it without relying on IOKit. My solution relies on absolutely no private APIs of any kind. Instead, I developed a component called
UIDeviceListener
that effectively hijacks the IOKit data fromUIDevice
.Give it a try, I've put together a simple sample program: https://github.com/eldoogy/PowerData
As an example, here is what the IOKit dictionary it retrieves tends to look like (note that it can vary by iOS versions and by device model, generation, etc.):
This project may help you to find out battery information.
https://github.com/Shmoopi/iOS-System-Services
It is likely that such apps use IOKit framework, which is public on OS X but private on iOS (it's not allowed by Apple to use private frameworks for App Store apps, although sometimes it can be overlooked during the review).
You can see a sample project here.