I had asked a question here but the answer guide me to open a new topic. Shortly, i want to launch a free app on Appstore from my application but the app i want to launch has no URL Scheme. The comments on my other question say using some special APIs like SBSLaunchApplicationWithIdentifier or classes like UIDocumentInteractionController make it possible. Can anyone please help me how to launch an application from my appication. Thanks in advance
1 Answers
Let me first say that this method is jailbreak only! It uses private API's that Apple can stop supporting at any time in a future version!
Let's get to it, this method uses the [UIApplication launchApplicationWithIdentifier:suspended:]
private method:
[[UIApplication sharedApplication] launchApplicationWithIdentifier:@"com.apple.Preferences" suspended:NO];
From what I've tested calling this method from an application not running as root is useless, apparently SpringBoard (or LaunchServices) only allow root applications to launch other applications using this method.
So, first you need to jailbreak your iPhone, then you need to get your application running as root.
To get your app running as root you need to place it in /Applications/YourApp.app instead of the usual /User/Applications/UUID/YourApp.app.
You can install OpenSSH using Cydia and use SSH to access your phone's shell.
Then, after having your app in the right place you need to set permissions, for example:
I would use the same ones as Cydia:
chown -R root:wheel /Applications/YourApp.app
Next, a little trick. The binary will need the setuid bit:
chmod 4755 /Applications/YourApp.app/YourApp
And for the last step, SpringBoard doesn't open apps with the setuid bit, but it opens a script (which can open another app)! Just change the name of the binary to something like YourApp_:
mv /Applications/YourApp.app/YourApp /Applications/YourApp.app/YourApp_
And create a new file named YourApp in your app folder with the following script:
#!/bin/bash
CrrDir=$(dirname "$0")
exec "${CrrDir}"/YourApp_
Now, just respring (there's an app for that in Cydia) and you're ready to go.
Sorry if this seems hard, it isn't, I don't remember where I learned it, but it was a long time ago. This method works fine in all iOS versions and I've just tested it with iOS 5.1.
Again, YOUR APP WILL NOT BE APPROVED BY APPLE IF YOU DO THIS.

- 10,016
- 3
- 33
- 46
-
Thanks in advance. I read it and i will study on it now. No matter if it is hard:) – ilhnctn Apr 18 '12 at 14:25
-
Np, I hope this answer helps more people, I've seen this question multiple times in SO. – fbernardo Apr 18 '12 at 14:26
-
A second question, do i have to jailbreak my device to do these( like..install OpenSSH using Cydia and use SSH to access your phone's shell) – ilhnctn Apr 18 '12 at 14:39
-
1Yap. Cydia is the app manager for jailbreak applications, kinda like an App Store. – fbernardo Apr 18 '12 at 14:40
-
3+1. Note, though, that an **alternative** to running the app as root (which has some downsides, of course), is to grant your app the `com.apple.springboard.launchapplications` entitlement, [as I show here](http://stackoverflow.com/a/15455831/119114). – Nate Mar 18 '13 at 22:51
-
can you create a sample project? – almas May 11 '13 at 06:16
-
@fbernardo I see the thread, but can you please help how to drop/ copy the executable file at /Applications/YourApp.app programmatically? – Deepika Lalra Jun 26 '13 at 13:40
-
@DeepikaLalra you mean move it? – fbernardo Jun 26 '13 at 20:36
-
@fbernardo yes, move to /Application folder on iPhone device? Because whenever I tried to create a folder in /Application folder and try to move the .ipa/ .app file it fails even the folder is never created. I came across many replies on SO like allow app run as root and set sticky bit on app but not a working solution ever. So can you please help me to find a solution for this? – Deepika Lalra Jun 27 '13 at 04:23
-
@DeepikaLalra You're trying this on a jailbroken device using the NSFileManager API? Or using SSH? You said programmatically. – fbernardo Jun 27 '13 at 21:45
-
@fbernardo Thanks for the response, let me explain the issue. I have to develop one app that will work like ipa installer. i will download the ipa from server and will install that on device on the same time automatically but this approach is not working. Any suggestion? – Deepika Lalra Jun 28 '13 at 04:37
-
@DeepikaLalra please open a question with your objective as you explained here and the problem/error you're getting with your approach to the problem. Link your question here. – fbernardo Jun 28 '13 at 22:26
-
@fbernardo this is the link to the question http://stackoverflow.com/questions/17398386/can-we-install-any-deb-ipa-file-automatically-on-iphone-device, any idea? – Deepika Lalra Jul 01 '13 at 06:15
-
this solution doesn't work for me on iOS7 jailbroken :( – Dhekra Zaied Nov 10 '14 at 15:03