Finding list of installed apps on iphone

后端 未结 7 1666
不知归路
不知归路 2020-11-27 07:03

Is it possible to programatically find out name of all apps installed on my iOS device ? Is there any API available for same ?

Thanks for the help

7条回答
  •  心在旅途
    2020-11-27 07:33

    Yes it is possible to get list of all installed app

    -(void) allInstalledApp
    {    
        NSDictionary *cacheDict;
    
        NSDictionary *user;
    
        static NSString *const cacheFileName = @"com.apple.mobile.installation.plist";
    
        NSString *relativeCachePath = [[@"Library" stringByAppendingPathComponent: @"Caches"] stringByAppendingPathComponent: cacheFileName];
    
        NSString *path = [[NSHomeDirectory() stringByAppendingPathComponent: @"../.."] stringByAppendingPathComponent: relativeCachePath];
    
        cacheDict    = [NSDictionary dictionaryWithContentsOfFile: path];
    
        user = [cacheDict objectForKey: @"User"];
    
        NSDictionary *systemApp=[cacheDict objectForKey:@"System"];
    }   
    

    systemApp Dictionary contains the list of all system related app and user Dictionary contains other app information.

提交回复
热议问题