Note : Your Application will be sand-boxed in any Apple Device and you can only use the information inside that sand-boxed environment. You are not allowed to use information of other Application out side your Application Environment in Non-jailbroken Devices. Apple will reject your app if you will try to use that below code for Non-jailbroken Devices. Use this code for jailbroken Devices only.
Sample Code :
-(NSMutableArray *)desktopAppsFromDictionary:(NSDictionary *)dictionary
{
NSMutableArray *desktopApps = [NSMutableArray array];
for (NSString *appKey in dictionary) {
[desktopApps addObject:appKey];
}
return desktopApps;
}
-(void)installedApp
{
static NSString* const installedAppListPath = @"/private/var/mobile/Library/Caches/com.apple.mobile.installation.plist";
BOOL isDir = NO;
if([[NSFileManager defaultManager] fileExistsAtPath: installedAppListPath isDirectory: &isDir] && !isDir)
{
NSMutableDictionary *cacheDict = [NSDictionary dictionaryWithContentsOfFile: installedAppListPath];
NSDictionary *system = [cacheDict objectForKey: @"System"];
NSMutableArray *installedApp = [NSMutableArray arrayWithArray:[self desktopAppsFromDictionary:system]];
NSDictionary *user = [cacheDict objectForKey: @"User"];
[installedApp addObjectsFromArray:[self desktopAppsFromDictionary:user]];
NSLog(@"installedApp :: %@",installedApp);
}
else
{
NSLog(@"Error..");
}
}
Credit goes to Igor Fedorchuk.
There is also one Library called AppList. You can use it on jailbroken Devices.