Get list of all installed application in ios 8

荒凉一梦 提交于 2019-12-28 08:10:13

问题


How to get list of all installed Applications on iPhone device programmatically in iOS 8.

If anyone knows the solution by using private APIs(but device non-jailbroken) then its well and good.

I know that it is possible using iTunes Search API, but it gives only those applications that are installed from iTunes. I need all the applications on device, whether it is from iTunes or user-developed or system apps.


回答1:


try this. it works,I've tested.

#include <objc/runtime.h>
Class LSApplicationWorkspace_class = objc_getClass("LSApplicationWorkspace");
NSObject* workspace = [LSApplicationWorkspace_class performSelector:@selector(defaultWorkspace)];
NSLog(@"apps: %@", [workspace performSelector:@selector(allApplications)]);



回答2:


I refactored above code for Xcode 7.3. It is working perfectly fine on iOS9.

 #include <objc/runtime.h>
 Class LSApplicationWorkspace_class = objc_getClass("LSApplicationWorkspace");
 SEL selector=NSSelectorFromString(@"defaultWorkspace");
 NSObject* workspace = [LSApplicationWorkspace_class performSelector:selector];
 SEL selectorALL = NSSelectorFromString(@"allApplications");
 NSLog(@"apps: %@", [workspace performSelector:selectorALL]);


来源:https://stackoverflow.com/questions/26969923/get-list-of-all-installed-application-in-ios-8

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!