Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

get list of installed applications on iphone objective-c

I have an application that needs to get the list of installed (other, maybe third party) applications on the device. How can it be done? Or can it be done at all?

like image 214
Oleg Avatar asked Dec 27 '11 13:12

Oleg


4 Answers

You could scan all your apps through apple private framework "MobileInstallationInstall".

The method is like below:

NSDictionary *options = [NSDictionary dictionaryWithKeyAndValues:@"ApplicationType",@"Any",nil]
NSDictionary *apps = MobileInstallationLookup(options);

it can only be used in JB devices.

like image 119
magicd Avatar answered Nov 09 '22 12:11

magicd


-(NSArray *) installedApps
{
    BOOL isDir enter code here= NO;
    NSDictionary *cacheDienter code herect;
    NSDictionary *user;
    static NSString *const cacheFileName = @"com.apple.mobile.installation.plist";
    NSString *relativeCachePath = [[@"Library" stringByAppendingPathComponent: @"Caches"] stringByAppendingPathComponent: cacheFileName];
    NSString *path = [[NSHomeDirectory() stringByAppendingPathComponent: @"../.."] stringByAppendingPathComponent: relativeCachePath];
    if ([[NSFileManager defaultManager] fileExistsAtPath: path isDirectory: &isDir] && !isDir) // Ensure that file exists
    {
        cacheDict    = [NSDictionary dictionaryWithContentsOfFile: path];
        user = [cacheDict objectForKey: @"System"]; // Then all the user (App Store /var/mobile/Applications) apps
    }



    //NSLog(@"Installed Applications = %@",[user allKeys]); 
    //return [user allKeys];
    return nil;
}

this will give you the array of name of installed app using private API

like image 26
Ali3n Avatar answered Nov 09 '22 12:11

Ali3n


there is no public API from apple to fetch such list from iOS device (iPod Touch/iPhone/iPad)

like image 5
Saurabh Passolia Avatar answered Nov 09 '22 10:11

Saurabh Passolia


I doubt if something is available(if some iphone is jailbreaked and user can access file system, then it will be possible, but i am not aware of this.), but you can use following link and with the help of this you can check what all app are present and you can customize with some of your needs.

like image 3
rishi Avatar answered Nov 09 '22 11:11

rishi