iOS-获取安装所有App的Bundle ID

我们先导入#import <objc/runtime.h>头文件

Class LSApplicationWorkspace_class = objc_getClass("LSApplicationWorkspace");
NSObject* workspace = [LSApplicationWorkspace_class performSelector:@selector(defaultWorkspace)];
NSLog(@"apps: %@", [workspace performSelector:@selector(allApplications)]);

推荐阅读更多精彩内容