【问题标题】:How to find out how many applications is installed in my ios device from ios app [duplicate]如何从 ios 应用程序中找出我的 ios 设备中安装了多少应用程序 [重复]
【发布时间】:2014-04-10 04:39:36
【问题描述】:

我能找到安装在我的 ios 设备中的所有应用程序的列表吗?在 ios sdk 的帮助下。或任何可以为我提供结果的应用程序或代码。

请给我建议。

提前致谢。

【问题讨论】:

  • 我知道这种方式,但那是使用私有 API,如果您使用这种方式,那么您将无法将您的应用程序放在 App Store 上。如果您仍然想要,请告诉我
  • @MehulThakkar 请您解释一下用于查找 iphone 上已安装应用程序列表的私有 api,然后请提出建议
  • NSArray *allBundles = [[objc_getClass("SBApplicationController") sharedInstance] allApplications];
  • 从上面的命令,你会得到你设备中安装的所有SBApplications的数组,现在你可以通过调用SBApplication的方法(在github中搜索私有头文件)来获取任何应用程序的信息,例如。 SBApplication *app=[allBundles objectAtIndex:2]; [app bundleIndentifier] 将给它 bundleId,[app displayIdentifier] 将给它 appName

标签: ios


【解决方案1】:

您可以使用此代码获取用户安装的所有应用程序列表和名称...

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"];

我在 ios6 中测试过它工作正常

【讨论】:

    猜你喜欢
    • 2014-09-21
    • 1970-01-01
    • 2013-12-18
    • 2019-11-25
    • 1970-01-01
    • 1970-01-01
    • 2013-06-03
    • 2013-04-29
    • 2021-12-24
    相关资源
    最近更新 更多