I am developing a C# .NET console application that extracts hardware data from iPhones connected to a PC via a working USB cable. I am currently using a .NET wrapper for libimobiledevice.
So far, my connection works perfectly. I am successfully communicating with lockdownd and can retrieve basic device properties like the IMEI, IMEI2, and Serial Number. However, I am hitting a wall trying to extract two specific data points: Device Color and Battery Health (Maximum Capacity).
What I’ve tried:
-
Color: I’ve tried querying DeviceColor and DeviceEnclosureColor. Depending on the iOS version, it either fails or returns an arbitrary hex code or integer (e.g., 1, 2, or #3b3b3c) rather than a string like “Deep Purple”, and I cannot find an official Apple mapping table for these codes.
-
Battery Health: I know tools like 3uTools and coconutBattery can read this via USB. I’ve tried using the equivalent of idevicediagnostics ioregentry AppleSmartBattery (and AppleARMPMUCharger for older models). However, on modern iOS versions, the FullChargeCapacity often just returns 100 or the data seems restricted.
Every solution or AI suggestion I’ve found online seems outdated for modern iOS versions.
My Question: How are commercial desktop tools reliably pulling accurate battery health and exact color names via USB? Is there a specific registry key, an updated open-source library, or even a paid commercial API/SDK that I can integrate into my .NET app to get these two data points accurately?