List the Versions of all the applications installed in iOS device programmatically

馋奶兔 提交于 2019-12-06 08:09:19
Mahendra Kumar

That's possible, please try the below code.

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

    for (LSApplicationProxy *apps in [workspace performSelector:@selector(allApplications)])
    {         
        NSString *localizedName = apps.localizedName;

        if([apps.applicationType isEqualToString:@"User"])
        {
            NSLog(@"\nlocalizedName: %@",localizedName);
            NSLog(@"minimumSystemVersion: %@",apps.minimumSystemVersion);
            NSLog(@"fileSharingEnabled: %d",apps.fileSharingEnabled);
            NSLog(@"sdkVersion: %@",apps.sdkVersion);
            NSLog(@"teamID: %@",apps.teamID);
        }
    }

For this you need to place 4 classes in your app:

LSApplicationWorkspace, LSResourceProxy, LSBundleProxy, LSApplicationProxy.
Harrison Xi

In iOS8 and before, we can use canOpenUrl to get installed applications which registered schemes. In iOS9, you must add a "white list" into your info.plist file. Only the application in the "white list" can be checked. And the limit count of the "white list" is 50. So you'd better jailbreak your device.

See more information: How to check particular app is already installed on iphone device or not?

Another one: http://useyourloaf.com/blog/querying-url-schemes-with-canopenurl.html

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!