最近研究ios的app安装方法,看到XY苹果助手的安装方式有闪装和下载安装两种方式,前者应该是itms-services协议的安装方式,但是后者看表现是应该是先将ipa下载到本地然后本地安装,但是查了半天只查到私有api(MobileInstallationInstall)方法,但是这个在非越狱的ios8.3(据说IOS6上就不行)上一直返回-1,有没有高手知道其他不越狱也能实现安装本地ipa的方法,下面是我查到的私有api的实现方法,但是目前没法用
typedef int (*MobileInstallationInstall)(NSString *path, NSDictionary *dict, void *na, NSString *path2_equal_path_maybe_no_use);
IPAResult IPAInstall(NSString *path)
{
    void *lib = dlopen("/System/Library/PrivateFrameworks/MobileInstallation.framework/MobileInstallation", RTLD_LAZY);
    if (lib)
    {
        MobileInstallationInstall pMobileInstallationInstall = (MobileInstallationInstall)dlsym(lib, "MobileInstallationInstall");
        if (pMobileInstallationInstall)
        {
            NSString *name = [@"Install_" stringByAppendingString:path.lastPathComponent];
            NSString* temp = [NSTemporaryDirectory() stringByAppendingPathComponent:name];
            if (![[NSFileManager defaultManager] copyItemAtPath:path toPath:temp error:nil]) return IPAResultFileNotFound;            int ret = (IPAResult)pMobileInstallationInstall(temp, [NSDictionary dictionaryWithObject:@"User" forKey:@"ApplicationType"], 0, path);
            [[NSFileManager defaultManager] removeItemAtPath:temp error:nil];
            return ret;
        }
    }
    return IPAResultNoFunction;
}