I need to list all installed apps on iPhone with the help of coding. I am using a jailbroken iPhone. I have used ihasapp API, but it is not showing me the complete list of all installed apps. Please help me with the code.
I got a list of all installed application in my iPhone. It uses private framework but it's not jail broken device. Lookout below piece of code.
#include <objc/runtime.h>
Class LSApplicationWorkspace_class = objc_getClass("LSApplicationWorkspace");
SEL selector=NSSelectorFromString(@"defaultWorkspace");
NSObject* workspace = [LSApplicationWorkspace_class performSelector:selector];
SEL selectorALL = NSSelectorFromString(@"allApplications");
NSLog(@"apps: %@", [workspace performSelector:selectorALL]);
I have tried this code and it's workings well on iOS9.
There is a private API SBSCopyApplicationDisplayIdentifiers
It's signature is following
CFArrayRef SBSCopyApplicationDisplayIdentifiers(bool onlyActive, bool debuggable);
If you link to SpringboardServices framework and use it, it will return the list of installed apps.
Update 1
Here is example of usage copied from here
CFArrayRef SBSCopyApplicationDisplayIdentifiers(bool onlyActive, bool debuggable);
int main() {
char buf[1024];
CFArrayRef ary = SBSCopyApplicationDisplayIdentifiers(false, false);
for(CFIndex i = 0; i < CFArrayGetCount(ary); i++) {
CFStringGetCString(CFArrayGetValueAtIndex(ary, i),buf, sizeof(buf), kCFStringEncodingUTF8);
printf("%s\n", buf);
}
return 0;
}
Don't forget to link to pravite framework SpringboardServices.
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