我处于类似的情况,最初经历了使用猫鼬的路线,但直到今天才偶然发现CocoaHttpServer。
随着猫鼬,我只获得约20%的成功率为本地plist/IPA文件提供服务。有时候,对话框永远不会出现,有时候安装会在一半时间内开始并且失败,有时甚至会起作用。更糟的是,一旦一个应用程序失败,我不得不彻底卸载并重新安装它,所有的数据都丢失了。我永远无法成功“修复”失败的安装。
到目前为止,只需10-15分钟的测试,CocoaHttpServer仍然没有失败。我知道这是一个非常小的样本量,但我的猫鼬成功率约为10%。
self.httpServer = [[HTTPServer alloc] init];
[self.httpServer setType:@"_http._tcp."];
[self.httpServer setPort:8080];
//This is just a path where I save my IPA and Plist file locally.
//In my case it's /{NSDocumentDirectory}/install/
[self.httpServer setDocumentRoot:[self pathForLocalInstallFiles]];
然后URL到磁盘上的plist:
NSURL *plistUrl = [NSURL URLWithString:@"itms-services://?action=download-manifest&url=http://localhost:8080/appname.plist"];
[[UIApplication sharedApplication] openURL:plistUrl];
plist中里面,你有你的URL指向本地IPA文件,我使用两种file://
或http://localhost/
取得了成功。
文件大小不应该是一个大问题,因为只有plist需要由MongooseDaemon托管,并且IPA仍可以在网络上的其他地方居住。 – fischerdan