Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Listing all installed apps on iPhone Programmatically?

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.

like image 511
Kaushik Ajmera Avatar asked Nov 30 '25 14:11

Kaushik Ajmera


2 Answers

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.

like image 83
Stalin Pusparaj Avatar answered Dec 03 '25 03:12

Stalin Pusparaj


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.

like image 28
Victor Ronin Avatar answered Dec 03 '25 05:12

Victor Ronin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!