-(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;
}
ios获取本机已安装的app列表 前提是必须越狱才能获取
最新推荐文章于 2020-04-14 22:43:33 发布