iOS获取手机上app信息

在代码中插入一段查询网址即可获取app信息以及版本信息。
查询命令:http://itunes.apple.com/lookup?id=xxxxxxxxx(9位appid数字)

获取设备上所有app (为LSApplicationProxy 对象)
Class LSApplicationWorkspace_class =     objc_getClass("LSApplicationWorkspace");
   NSObject *workspace = [LSApplicationWorkspace_class performSelector:@selector(defaultWorkspace)];
   NSArray *apps = [workspace performSelector:@selector(allInstalledApplications)];
   NSLog(@"apps: %@", apps);
获取版本信息
    [apps[0] performSelector:NSSelectorFromString(@"shortVersionString")]

获取其他属性可参考

https://github.com/nst/iOS-Runtime-Headers/blob/master/Frameworks/MobileCoreServices.framework/LSApplicationProxy.h

你可能感兴趣的:(iOS获取手机上app信息)