In iTunes, you can see the charge status of the iPhone currently connected:
This updates as the phone charges, and even shows when the phone is done charging.
Is there a way I can discover the charge status programmatically from the Mac? Any programming language or API is fine.
See the iPhone battery percentage in the status bar On an iPhone with Face ID: Swipe down from the top-right corner. On an iPhone with a Home button: Go to Settings > Battery, then turn on Battery Percentage.
From the Home screen, tap the Apps Key > Settings > Battery. The battery level (as a percentage of fully charged) and the battery status (Charging or Discharging) is displayed at the top of the screen.
I would recommend setting up a bonjour service in an App on the iOS device to communicate with the computer. The app will then communicate the changes in the batter status using the batteryMonitoringEnabled property of UIDevice. Take a look at the samples code here.
BatteryStatus Sample Code
And here is the class reference
UIDevice Class Reference
And finally Bonjour programming
Bonjour programming guide
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With