Quick code question

im trying to find a language that has access to an iphone/ios library to access batty percent when plugged into a computer. I know apps have done this before but im not sure how they have. anyone have any language recommendations that have access to an ios library that we can access.I heard that its possible with C++ if so what is the code to access battery percent of an iphone that is plugged into a computer and the computer is running the code. Thank you in adavcen to anyone that is of any help.

Replies

There is a supported way to get battery level for code running on iOS (that is, the

batteryLevel
property of
UIDevice
), but it sounds like you want to run code on macOS that gets the battery level for an iOS device that’s plugged in via USB. There’s no supported way to do this. The mechanism used by iTunes is private, and thus not available to third-party developers.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"