ios开发不越狱获取本地应用列表通过调用运行时库

核心代码:

#include 
 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]);

此方法可能在apple上审核不通过

你可能感兴趣的:(IOS开发)