I am making an in-house (Enterprise) app. I want to delete other installed apps from the iOS device programmatically. I have successfully retrieved the installed apps' info (e.g. name, bundleId, version, icon etc.) using Apple's private framework methods. Please tell me how can I do that (i.e. delete an app). Thanks.
Asked
Active
Viewed 1,203 times
0
-
I think you will need Super User Access. – Blind Ninja Aug 12 '15 at 04:46
-
@HarvantS. What is super user access ? – iOS_Learner Aug 12 '15 at 04:50
-
@Salman superuser access means you need to jailbreak your device and you become super user . – Badal Shah Aug 12 '15 at 04:52
-
`SUDO` Keyword in linux and unix . That mean `Super User DO` . @BadalShah Yes. – Blind Ninja Aug 12 '15 at 04:53
-
@BadalShah Thanks for explanation . But I don't want to jailbrake my device. – iOS_Learner Aug 12 '15 at 04:55
-
@HarvantS. I found one method in Private Headers .... That is - (BOOL)uninstallApplication:(id)arg1 withOptions:(id)arg2; Its in LSApplicationworkspace. It takes two arguments. I passed first argument bundle identifier and second arguement was nil. This method deleted app successfully but after that crash occurred. – iOS_Learner Aug 12 '15 at 05:06
-
@BadalShah I found one method in Private Headers .... That is - (BOOL)uninstallApplication:(id)arg1 withOptions:(id)arg2; Its in LSApplicationworkspace. It takes two arguments. I passed first argument bundle identifier and second arguement was nil. This method deleted app successfully but after that crash occurred. – iOS_Learner Aug 12 '15 at 05:07
-
Its working for me without any crash but the method return `NO` sometimes. – Blind Ninja Aug 12 '15 at 05:46
-
FYI: You can jailbreak your phone, and hide Cydia, if that is okay with you. – Munim Aug 12 '15 at 06:18
-
@Thibaud David any suggestions – iOS_Learner Aug 19 '15 at 11:42
-
Did you ever get a reliable solution for this? – newenglander May 05 '16 at 10:47
3 Answers
2
Here is a solution (No jailbreak No crash) but its not working every time. Sometime it failed to uninstall application and return NO
.
NSBundle *b = [NSBundle bundleWithPath:@"/System/Library/PrivateFrameworks/MobileCoreServices.framework"];
BOOL success = [b load];
if(success)
{
Class LSApplicationWorkspace = NSClassFromString(@"LSApplicationWorkspace");
id si = [LSApplicationWorkspace valueForKey:@"defaultWorkspace"];
SEL selector=NSSelectorFromString(@"uninstallApplication:withOptions:");
BOOL what=[si performSelector:selector withObject:@"Bundle_ID" withObject:nil];
}

Blind Ninja
- 1,063
- 13
- 28
1
This is not possible with a non Jailbroken device, even with private APIs.

Rukshan
- 7,902
- 6
- 43
- 61
-
@sleepwalkersfx I found one method in Private Headers .... That is - (BOOL)uninstallApplication:(id)arg1 withOptions:(id)arg2; Its in LSApplicationworkspace. It takes two arguments. I passed first argument bundle identifier and second arguement was nil. This method deleted app successfully but after that crash occurred. – iOS_Learner Aug 12 '15 at 05:07
0
You will need an MDM solution, which gives the company quite a lot of power over enrolled devices. Using iOS software, there is no way whatsoever. And I'll just assume that your enterprise won't let jailbroken phones anywhere near it!

gnasher729
- 51,477
- 5
- 75
- 98