pymobiledevice3
pymobiledevice3 copied to clipboard
Collect iPhone Battery Health from Device
Hi , Currently there is a way to collect iphone battery health using ioreg via IOPMPowerSource or AppleSmartBattery AppleRawMaxCapacity NominalChargeCapacity
but its dsnt return value which matches device inside Battery Health "Setting -> Battery -> BatteryHealth -> Maximum Capacity" is there a way to collect that information using pymobildevice ? @doronz88
I don't think this value is reflected in some "clear API". Instead, I remember reversing arround this value once and figuring out it is calculated using a combination of values: including the capacity, cycle count and a few more. I don't know the exact calculation and it should be possible to figure it out just from the IORegistry values
thanks for response @doronz88 can u point out those params / values u used to calculate this value
I don't remember in which binary it even was in the first place. Just that there was some kind of formula related to these parameters. I recommend looking for where they are referenced and tracing what are they used for.
"powerd" must be the binary where this calculation ll be because that's what print data on syslog regarding battery health
@doronz88 did u get a chance to see BatteryHealth data ?
I'm not currently researching arround there. As I said before, I think that the proper way to debug this is using the printed syslog lines. I do think rpc-project could possibly help debug this. I'd try changing the different values of the battery (such as the current capacity) and look at what syslog lines are printed afterward as a result. I guess powerlogd
will probably monitor this value and update settings accordingly which could explain how the bettery life data is calculated.
@doronz88 thanks ll look info this
Hi @Dantee296, I might try to reverse engineer powerd
and respond you later.
@vadimszzz were u able to ?
@Dantee296 What was your solution ?