想从本地plist(null)安装iOS应用程序

我试图从设备的文件系统上的plist安装一个iOS应用程序。

NSString *launchNewPlistURL = [NSString stringWithFormat:@"itms-services://?action=download-manifest&url=file://%@",[self saveFilePath]]; [[UIApplication sharedApplication]openURL:[NSURL URLWithString:launchNewPlistURL]]; 

并提示“(null)想要安装{myappname}”。 通常(null)是plist来自的域名,但是在这种情况下它是空的,因为它是一个本地文件。

反正有指定plist中的标题或在URL中传递一个虚假的域名?

谢谢,丹

您可以使用项目MongooseDaemon来创build一个HTTP本地服务器。

有一个类似于http://192.168.xxx.xxx/yourplist.plist的域来安装它。

无论如何,我认为你不能用一个大的国际音标。 我尝试了大于15MB的IPA,开始安装非常慢。

我也遇到了类似的情况,最初经历了使用Mongoose的路线,但是直到今天才偶然发现了CocoaHttpServer 。

有了mongoose,我只获得了20%左右的成功率,为当地的plist / IPA文件提供服务。 有时localhost would like to install对话框从来没有出现,有时安装开始和中途失败,有时它实际上工作。 更糟的是,一旦一个应用程序失败,我不得不完全卸载并重新安装它,所以所有的数据都丢失了。 我从来没有能够成功“修复”一个失败的安装。

到目前为止,只需10-15分钟的testing,CocoaHttpServer还没有失败。 我知道这是一个非常小的样本量,但是我的mongoose成功率在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]]; 

然后在磁盘上的plist的URL:

 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/