我使用的是 SpringBoardServices这个私有库,通过bundleID去打开应用程序,但是结果只在模拟器上有效,真机上无效
附上代码
void* sbServices = dlopen("/System/Library/PrivateFrameworks/SpringBoardUIServices.framework/SpringBoardUIServices", RTLD_LAZY);
int (*SBSLaunchApplicationWithIdentifier)(CFStringRef identifier, Boolean suspended) = dlsym(sbServices, "SBSLaunchApplicationWithIdentifier");
SBSLaunchApplicationWithIdentifier((__bridgeCFStringRef)bundleId, NO);