Get list of installed apps on iPhone
Asked Answered
L

5

12

Is there a way (some API) to get the list of installed apps on an iPhone device.

While searching for similar questions, I found some thing related to url registration, but I think there must be some API to do this, as I don't want to do any thing with the app, I just want the list.

Luthern answered 6/1, 2011 at 10:51 Comment(0)
P
17

No, apps are sandboxed and Apple-accepted APIs do not include anything that would let you do that.

You can, however, test whether a certain app is installed:

  • if the app is known to handle URLs of a certain type
  • by using [[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"thisapp://foo"]

You can get a list of apps and URL schemes from here.

Prone answered 6/1, 2011 at 11:2 Comment(1)
There's a slick little framework that takes care of this and checks to see what's currently running (whether it has a URL scheme or not) called iHasApp. Just learned about it: ihasapp.comUntitled
H
4

For jailbroken devices you can use next snipped of code:

-(void)appInstalledList
{
 static NSString* const path = @"/private/var/mobile/Library/Caches/com.apple.mobile.installation.plist";

NSDictionary *cacheDict = nil;
BOOL isDir = NO;
if ([[NSFileManager defaultManager] fileExistsAtPath: path isDirectory: &isDir] && !isDir) 
{
    cacheDict = [NSDictionary dictionaryWithContentsOfFile: path];

    NSDictionary *system = [cacheDict objectForKey: @"System"]; // First check all system (jailbroken) apps
    for (NSString *key in system)
    {
        NSLog(@"%@",key);
    }
    NSDictionary *user = [cacheDict objectForKey: @"User"]; // Then all the user (App Store /var/mobile/Applications) apps

    for (NSString *key in user)
    {
        NSLog(@"%@",key);
    }
    return;
}
NSLog(@"can not find installed app plist");                   
}
Heiskell answered 27/8, 2012 at 10:18 Comment(2)
Not even enter into if condition. What is the problem from my side?Photosynthesis
@Photosynthesis : is your device jailbroken?, above code is working only for jailbroken devicePulse
B
3

for non jailbroken device, we can use third party framework which is called "ihaspp", also its free and apple accepted. Also they given good documentation how to integrate and how to use. May be this would be helpful to you. Good luck!!

https://github.com/danielamitay/iHasApp

Breen answered 12/5, 2014 at 8:8 Comment(4)
Thank you, I am no longer working on it, but I will surely check it.Luthern
you are welcome brother!! definately it works, I already tried it!!Breen
This is not working properly, It doesnot show my all apps installed on device, it uses iTunes API, so app installed by user/developer are not shown in this listPulse
@Mr.Mehul Thakkar, i checked with iOS 7 only, i didnt tried with iOS 8Breen
A
3

You could do this by using the following:

 Class LSApplicationWorkspace_class = objc_getClass("LSApplicationWorkspace");
 SEL selector = NSSelectorFromString(@"defaultWorkspace");

 NSObject* workspace = [LSApplicationWorkspace_class performSelector:selector];

 SEL selectorALL = NSSelectorFromString(@"allApplications");

 NSMutableArray *Allapps = [workspace performSelector:selectorALL];

 NSLog(@"apps: %@", Allapps);

And then by accessing each element and splitting it you can get your app name, and even the Bundle Identifier, too.

Athenaathenaeum answered 20/10, 2016 at 7:57 Comment(0)
B
2

Well, not sure if this was available back when the last answer was given or not (Prior to iOS 6) Also this one is time intensive, yet simple: Go into settings > Gen. >usage. The first category under usage at least right now is Storage.

It will show a partial list of apps. At the bottom of this partial list is a button that says "show all apps". Tap that and you'll have to go through screen by screen, and take screenshots (Quick lock button and home button takes a screenshot). I'm doing this now and I have hundreds of apps on my iPhone. So it's going to take me a while. But at least at the end of the process I'll have Images of all my apps.

Blindworm answered 12/11, 2012 at 14:15 Comment(2)
That's not really a programmatic approach though :-)Tintype
This was available before as well, but I wanted to do this programatically. Anyways, thanks for taking time to provide an answer :)Luthern

© 2022 - 2024 — McMap. All rights reserved.