iOS-Runtime-Headers
iOS-Runtime-Headers copied to clipboard
which private framework to use to get the battery usage?
Hi, all: We used /System/Library/PrivateFrameworks/PowerlogLoggerSupport.framework to get the battery usage on iOS 6/7, but now it's gone in iOS 8 private frameworks. Do you know if there's any alternative? Or do you know any other groups we could ask this question?
Thanks.
Hi.
It seems that BatteryCenter.framework
under PrivateFrameworks
seems to be your framework in search.
I'm trying to access it with the following code:
NSBundle *bundle = [NSBundle bundleWithPath:@"/System/Library/PrivateFrameworks/BatteryCenter.framework"];
BOOL success = [bundle load];
if(success) {
Class BCBatteryDevice = NSClassFromString(@"BCBatteryDevice");
id si = [[BCBatteryDevice alloc] init];
NSLog(@"Charging: %@", [si valueForKey:@"charging"]);
}
Although I'm getting NULL
. I would really like to see if you can get it to work.
Thanks. Good luck. :)