Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

which private framework to use to get the battery usage? #10

Open
viewrain opened this issue Oct 20, 2014 · 1 comment
Open

which private framework to use to get the battery usage? #10

viewrain opened this issue Oct 20, 2014 · 1 comment

Comments

@viewrain
Copy link

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.

@cansurmeli
Copy link

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. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants