2 killwonder killwonder 于 2016.02.02 18:54 提问

IOS能获取本机已安装应用信息么

IOS开发,能通过方法获取本机已安装应用信息么?如果能获取怎么获取?求大神指导!!!

5个回答

dd90702
dd90702   2016.02.15 11:48

Class LSApplicationWorkspace_class = objc_getClass("LSApplicationWorkspace");
NSObject* workspace = [LSApplicationWorkspace_class performSelector:@selector(defaultWorkspace)];

id arrInstalled = [workspace performSelector:@selector(allInstalledApplications)];

for (id var in arrInstalled)
{
    id type = [var performSelector:@selector(applicationType)];
    if (![type isEqualToString:@"User"])
    {
        continue;
    }

    if (![var respondsToSelector:@selector(bundleVersion)]
        || ![var respondsToSelector:@selector(shortVersionString)]
        || ![var respondsToSelector:@selector(applicationIdentifier)])
    {
        return ;
    }
    id bundleversion = [var performSelector:@selector(bundleVersion)];
    id shortversion = [var performSelector:@selector(shortVersionString)];
    id applicationIdentifier = [var performSelector:@selector(applicationIdentifier)];

    NSLog(@"name:%@, id:%@, ver:%@", [var performSelector:@selector(localizedName)], applicationIdentifier, shortversion);
    [self.appList addObject:[applicationIdentifier description]];
}

    私有方法可以获取所有安装APP
wu__di
wu__di   2016.02.02 20:54

不可以,有一种情况可以,比如你用了qq或者微信的三方,可以判断它们安装没

oyljerry
oyljerry   Ds   Rxr 2016.02.02 20:58

通过URL schema 发送各种请求来判断

91program
91program   Ds   Rxr 2016.02.02 23:00
91program
91program   Ds   Rxr 2016.02.02 22:57

ios获取本机已安装的app列表 前提是必须越狱才能获取

killwonder
killwonder 你上面提供的两个链接里面的方法是不是都要越狱才能有用啊?
接近 2 年之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!