• 获取已安装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;

    }

  • 相关阅读:
    Linux环境下搭建Git仓库
    Linux环境下安装zookeeper
    nginx: [error] open() "/var/run/nginx/nginx.pid" failed (2: No such file or directory)
    Dart语言特性必备了解!
    Flutter中打造多行列列表GridView组件的使用
    Flutter常用组件(Widget)解析-Scaffold
    Flutter常用组件(Widget)解析-ListView
    Flutter常用组件(Widget)解析-Image
    Flutter常用组件(Widget)解析-Text
    Flutter常用组件(Widget)解析-Container
  • 原文地址:https://www.cnblogs.com/huangzs/p/8066046.html
Copyright © 2020-2023  润新知