0

Just now , I create a project based on Single View Application on Xcode6.3.1, then I create a button on Main.storyboard. The code is like this when the button touched:

NSString * bundleId = @"com.apple.iBooks";
void* sbServices = dlopen("/System/Library/PrivateFrameworks/SpringBoardServices.framework/SpringBoardServices", RTLD_LAZY);
int (*SBSLaunchApplicationWithIdentifier)(CFStringRef identifier, Boolean suspended) = dlsym(sbServices, "SBSLaunchApplicationWithIdentifier");
const char *strBundleId = [bundleId cStringUsingEncoding:NSUTF8StringEncoding];
int result = SBSLaunchApplicationWithIdentifier((__bridge CFStringRef)bundleId, NO);
dlclose(sbServices);

But it did not work. Then I do like this site tell me , Launch other application without URL schema in iphone? It did not work,either. Please help me. My device is iPhone4s, iOS 7.1.2, jailbroken.

Community
  • 1
  • 1
steiff
  • 93
  • 1
  • 9
  • possible duplicate of [How to launch an APP in background in iOS 6.x silently](http://stackoverflow.com/questions/14999658/how-to-launch-an-app-in-background-in-ios-6-x-silently) – creker May 27 '15 at 09:14
  • @creker - thank you for your answer, but maybe the link http://stackoverflow.com/questions/14999658/how-to-launch-an-app-in-background-in-ios-6-x-silently can not solve my problem – steiff May 27 '15 at 09:46
  • then you did something wrong. Read about entitlements, without them the code will not work – creker May 27 '15 at 09:48
  • I want to know how to configure the entitlements – steiff May 27 '15 at 09:55

2 Answers2

1

* For jail break you can proceed with this *

There is a mechanism known as URL scheme, which can be used to open app from inside your app. but for that you need to do the proper url schemens setUp in your plist file. I strongly feel that you are not looking at this option.

* There is another way strictly not recommended ( except JAILBREAK PHONES) the API is private *, but you can do a try & enjoy in development mode.

  • openApplicationWithBundleID : To open the app using bundle identifier.
  • - (NSArray*)allInstalledApplications; : This will list you all the installed application on your device.

If you want to see an interesting demo it this, kindly run this app in your phone & see the Apple Watch style, spring board, with all apps listed & can be launched on tap.

Hope that gives the better idea of the private api usage.

Balram Tiwari
  • 5,657
  • 2
  • 23
  • 41
  • With jailbreak there is no such thing as restriction. :) – allprog May 27 '15 at 11:19
  • @Balram Tiwari - Thank for clarifying. The demo works well. And I solve the problem . In the demo , it gives an idea of the private api usage. – steiff May 27 '15 at 12:44
0

Install the com.conradkramer.open open package from Cydia and you can run open com.bundle.id from shell via SSH or from an app.

radj
  • 4,360
  • 7
  • 26
  • 41