可能重复: 获取所有已安装应用程序的列表
我正在寻找的应用程序控制系统工具,其中我想要一个列表的所有安装的应用程序名称和用户将允许改变那里的状态,即用户可以隐藏那些跳板。如果是,那怎么可能呢?请帮帮我?
发布于 2013-01-16 10:14:58
尝尝这个
-(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;
}这将给你一系列已安装的应用程序。
此链接还可以帮助您链接。
https://stackoverflow.com/questions/14355444
复制相似问题