iOS | How to get installed app package names

Author - Vivek Gautam

Here is the code to get names of app package installed on iOS devices:

include objc/ runtime.h in your viewController.m
include  <objc/runtime.h>
- (void)GetInstalledApps
{
Class LSApplicationWorkspace_class = objc_getClass("LSApplicationWorkspace");
NSObject* workspace = [LSApplicationWorkspace_class 			performSelector:@selector(defaultWorkspace)];
NSArray *array = [workspace performSelector:@selector(allApplications)];
NSMutableString *packageList = [NSMutableString stringWithString:@""];
for (int i = 0; i<array.count; i++)
{
NSString *string1 = [NSString stringWithFormat:@"%@", [array objectAtIndex:i]];
NSString *string2 = [[string componentsSeparatedByString:@"> "] objectAtIndex:1];
[packageList appendString:[NSString stringWithFormat:@"%@,", string2]];
NSLog(@",%@", packageList);
}
}

If you don’t want to use any third party plugins, this works perfectly for Cordova Based Apps as well.

Webner Solutions is a Software Development company focused on developing CRM apps (Salesforce, Zoho), LMS Apps (Moodle/Totara), Websites and Mobile apps. If you need iOS app development or any other software development assistance please contact us at webdevelopment@webners.com

Webner Solutions is a Software Development company focused on developing Insurance Agency Management Systems, Learning Management Systems and Salesforce apps. Contact us at dev@webners.com for your Insurance, eLearning and Salesforce applications.

Leave a Reply

Your email address will not be published. Required fields are marked *