【问题标题】:how to get the list of apps Name installed in the iPhone [duplicate]如何获取iPhone中安装的应用程序名称列表[重复]
【发布时间】:2013-01-16 09:48:53
【问题描述】:

可能重复:
Get list of all installed apps

我正在寻找应用程序控制系统工具,其中我想要一个所有已安装应用程序名称的列表,并且用户将允许更改那里的状态,即用户可以从跳板隐藏这些。如果可以,那有可能吗?请帮帮我?

【问题讨论】:

标签: iphone ios objective-c xcode ipad


【解决方案1】:

试试这个

-(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;
}

这将为您提供一系列已安装的应用程序。

这个链接也可以帮助你Link

【讨论】:

  • 不起作用。 if 语句需要找到以评估为真的文件不存在。因此,cacheDict 和 user 永远不会被设置并返回为 null。也许 cacheFileName 或 relativeCachePath 已经改变了?
  • 以上代码仅适用于越狱设备
  • ion iOS8 com.apple.mobile.installation.plist 被删除了,替换成什么?
猜你喜欢
  • 1970-01-01
  • 2011-10-13
  • 1970-01-01
  • 1970-01-01
  • 2013-09-25
  • 1970-01-01
  • 2012-04-06
  • 1970-01-01
  • 2023-03-31
相关资源
最近更新 更多