备注:以下是私有api 苹果审核会被拒绝。
导入头文件
#import <objc/runtime.h>
/// 获取其他APP信息(iOS11无效)
+ (NSArray *)getOtherAPPInfo{
Class lsawsc = objc_getClass("LSApplicationWorkspace");
NSObject* workspace = [lsawsc performSelector:NSSelectorFromString(@"defaultWorkspace")];
NSArray *Arr = [workspace performSelector:NSSelectorFromString(@"allInstalledApplications")];
for (NSString * tmp in Arr)
{
NSString * bundleid = @"";
NSString * target = [tmp description];
NSArray * arrObj = [target componentsSeparatedByString:@" "];
if ([arrObj count]>2) {
bundleid = [arrObj objectAtIndex:2];
}
if (![bundleid containsString: @"com.apple."]) {
NSLog(@"******* %@ *****",bundleid);
}
}
return Arr;
}