如何在iOS系统上从进程pid中获取其他应用程序图标?

如何在iOS系统上从进程pid中获取其他应用程序图标?,ios,macos,process,pid,Ios,Macos,Process,Pid,我看到这个问题: 现在我可以从进程pid获取应用程序路径,然后根据上面的问题,随着代码的吹扫,我无法获取应用程序图标 NSBundle* bundle = [NSBundle bundleWithPath:apppath]; NSArray *infostmp = [[bundle infoDictionary] objectForKey:@"CFBundleIconFiles"]; if(infostmp){ NSString* iconPath = [[NSString allo

我看到这个问题:

现在我可以从进程pid获取应用程序路径,然后根据上面的问题,随着代码的吹扫,我无法获取应用程序图标

NSBundle* bundle = [NSBundle bundleWithPath:apppath];
NSArray *infostmp = [[bundle infoDictionary] objectForKey:@"CFBundleIconFiles"];
if(infostmp){
     NSString* iconPath = [[NSString alloc] initWithString:[infostmp objectAtIndex:0]];
     UIImage*  icon =[UIImage imageWithContentsOfFile:iconPath];
}

您只能在越狱iOS中获取NSBundle对象,在非越狱iOS设备中,代码为:NSBundle*bundle=[NSBundle bundleWithPath:apppath];得到的捆绑是零。因此,您无法获取图标