• 获取已安装app的bundle id


    备注:以下是私有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;

    }

  • 相关阅读:
    每日日报
    设计模式分类及典型实现
    SpringBean的生命周期
    Nginx
    大话--单例模式
    类图--小总结
    设计模式原则概述
    大话--装饰者模式
    Redis基础
    SpringIOC的实现原理
  • 原文地址:https://www.cnblogs.com/huangzs/p/8066046.html
Copyright © 2020-2023  润新知