[编辑]我是jb我的设备。我在Github上找到了最新的私有API iOS-Runtime-Headers。
我想在我的应用中使用私有API。
我在github上找到了kennytm/iphone-private-frameworks,但它只支持iOS 3.x.我正在使用iOS 5.0.1。
我还在Google iPhone开发工具上找到了some codes。但它确实让我感到困惑。我是iPhone开发的新手。
我应该怎么做才能使用
[[UIApplication sharedApplication] launchApplicationWithIdentifier:@"com.a.b" suspended:NO];
有人可以给我一个方向或一些例子。非常感谢。
答案 0 :(得分:5)
1)在您的XCode项目中启用权利。
要向项目添加权利,请在项目导航器中选择项目,然后在有效目标上选择> 摘要 - > 权利 - >选中启用权利复选框。名为“ YourProject.entitlements ”的新文件将立即显示在项目导航器中。
2)将以下属性添加到Entitlements。
3)由于launchApplicationWithIdentifier:suspended:
是私有API ,您需要明确声明它以构建您的应用。只需在适当的位置添加以下代码:
// Simply make declaration inside a Category.
#import "BlahBlah.h"
@interface UIApplication (Undocumented)
- (void) launchApplicationWithIdentifier: (NSString*)identifier suspended: (BOOL)suspended;
@end
....
@implementation BlahBlah
...
4)构建您的项目。
5)将 YourProject.app 复制到设备的 / Application 文件夹中(例如,通过SFTP)
6) Respring 或重启iDevice。
7)...
8)利润!
Special API to launch an app from my application - 另一种解决方案
What is the bundle identifier of apple's default applications in iOS?