Search code examples
iosswiftswift4battery

iOS 12 – The simplest way to obtain battery cycle count for iPhone


I know that public API at the moment allows obtain only two useful properties for battery: batteryLevel and batteryState. Even after WWDC 2018 there's no any changes.

let batteryLevel = UIDevice.current.batteryLevel  /* from 0 to 1 */
let batteryState = UIDevice.current.batteryState  /* four states */

What's the simplest way to obtain battery cycle count in iOS 12 using free private API or Apple's official API?

P.S. UIDeviceListener isn't working in iOS 10/11/12. Also it's written in Objective-C.


Solution

  • Since the release of iOS 10, Apple has cut off access to battery details for third-party apps in the App Store, making these apps completely useless.

    At the moment there's no way to obtain battery cycle count for iPhone in iOS 12 using public APIs. Even Console app in macOS Mojave 10.14 doesn't show cycle counts for iPhone.

    So, the only robust way to see cycle counts is to install coconutBattery macOS application.

    enter image description here

    P.S. UIDeviceListener doesn't work in iOS 10 and higher (read this SO post).