2

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.

Midhun MP
  • 103,496
  • 31
  • 153
  • 200
Kaushik Ajmera
  • 33
  • 1
  • 1
  • 6
  • Check this: http://iphonedevsdk.com/forum/iphone-sdk-development/22289-possible-retrieve-these-information.html – Vishal Mar 11 '13 at 06:29
  • 1
    I have already gone through it. But for this we need to pass the bundle id to check whether a particular app is installed or not. But I need to list all installed apps. – Kaushik Ajmera Mar 11 '13 at 06:30
  • Ok i am also googling & find this link...but if you succeeded then also please tell me the way that you follow....Best of luck. – Vishal Mar 11 '13 at 06:38
  • 1
    sure vishal I will post my solution as answer if I am able to implement it successfully – Kaushik Ajmera Mar 11 '13 at 06:49
  • OK good Best of luck I am waiting your answer bro....I know you can do it.... – Vishal Mar 11 '13 at 06:51
  • Thanx vishal fro encouraging me, I have been really struggling over this task for past few weeks. Hope I could find a solution for this at the earliest. – Kaushik Ajmera Mar 11 '13 at 06:57
  • Of course, You will surely find solution for this...My wishes is with you....Every great work are not solve without difficulties....Just try & try hard in the end you will surely win.... – Vishal Mar 11 '13 at 07:00
  • Type this string (`[jailbreak] list installed apps`) into the stack overflow search field, and you'll get some answers. – Nate Mar 11 '13 at 07:36
  • possible duplicate of [Get list of all installed apps](http://stackoverflow.com/questions/7226406/get-list-of-all-installed-apps) – Pang Apr 13 '14 at 11:57
  • ion iOS8 the com.apple.mobile.installation.plist is deleted with what it's replaced please? – Dhekra Zaied Nov 21 '14 at 14:45

5 Answers5

9

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.

Stalin Pusparaj
  • 741
  • 9
  • 11
  • Great!!. Can you help me how to parse bundle identifier and application name?? – Vikash Rajput Dec 02 '16 at 14:00
  • This code will print the name of the first object `NSObject* oPoop = [sApplications objectAtIndex:0]; SEL selectorName = NSSelectorFromString(@"itemName"); NSLog(@"%@", [oPoop performSelector:selectorName]);` – Python Lord Jul 17 '17 at 18:22
4

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.

Victor Ronin
  • 22,758
  • 18
  • 92
  • 184
  • Hi Victor, can you please submit a piece of code so that I can run and see the results – Kaushik Ajmera Mar 12 '13 at 04:40
  • Hi victor, the code snippet you send is in c language but I need in objective c language dear – Kaushik Ajmera Mar 13 '13 at 05:10
  • @KaushikAjmera: In iOS development, you can mix C code with Objective C. Actually most of older frameworks (like CoreFoundation) are C frameworks. – Victor Ronin Mar 13 '13 at 14:35
  • How to link SpringboardServices when it's not available? – Jonny Apr 17 '14 at 08:11
  • Generally. There are two ways. One is dynamic loading - use dlopen and dlsym. And you can link to it statically. However, it's a little bit cumbersome - usually I add some public framerowk and after manually edit xcode configuration file to point to SoringboardServices – Victor Ronin Apr 17 '14 at 15:31
  • Is it working for iOS 8?, i have tried but not working, is there any problem with my code,or is it not working with iOS 8? – Mehul Thakkar Oct 27 '14 at 06:37
  • I am not sure. It worked well on iOS 6 and 7. However, Apple did a lot of hardening around private api's in iOS 8. – Victor Ronin Oct 27 '14 at 16:32
2

I use the AppList library myself to get a list of all installed apps. It uses private frameworks so it's also jailbreak-only. Check it out at https://github.com/rpetrich/AppList.

Update: @Nate is correct about this already being asked and answered. Check out: Get list of all installed apps

Community
  • 1
  • 1
newenglander
  • 2,019
  • 24
  • 55
1

I searched a lot to get the installed app list on iOS 11. But there is code to check the application currently installed on this device.

//If the device is iOS11
if ([[UIDevice currentDevice].systemVersion floatValue] >= 11.0) {
    NSBundle *container = [NSBundle bundleWithPath:@"/System/Library/PrivateFrameworks/MobileContainerManager.framework"];
    if ([container load]) {
        Class appContainer = NSClassFromString(@"MCMAppContainer");

        id test = [appContainer performSelector:@selector(containerWithIdentifier:error:) withObject:bundleId withObject:nil];
        NSLog(@"%@",test);
        if (test) {
            return YES;
        } else {
            return NO;
        }
    }
    return NO;

}
Prabakaran
  • 620
  • 1
  • 7
  • 8
0

Try this.

NSArray *appList = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:@"/Applications" error:nil];
NSLog(@"%@",appList);
shuvo
  • 705
  • 5
  • 15