简体   繁体   English

在iOS中以编程方式在iPhone上安装IPA文件

[英]Install an ipa file on iphone programatically in ios

Could someone please advise whether it is possible to install an ipa file programmatically in iOS that has been generated by Adhoc release ? 有人可以告诉我是否可以在Adhoc版本生成的iOS以编程方式安装ipa文件吗?

I have an application that when clicking on a button, it install another application, that is an ipa file (fetched from a server). 我有一个应用程序,当单击按钮时,它会安装另一个应用程序,即一个ipa文件(从服务器获取)。

I have tried the following, but it does not work: 我已经尝试了以下方法,但是不起作用:

   string url = "https://192.168.27.45/apps/TruckApp.iOS.plist";
   NSString stringUrl =  new NSString("itms-services://?action=download-manifest&url="+url);
   NSUrl fileUrl = new NSUrl(stringUrl);

   UIApplication.SharedApplication.OpenUrl(fileUrl);

There are several things to be checked: 有几件事要检查:

  • In which way doesn't it work? 它以哪种方式行不通? Is there anything going on, or do you simply see nothing on the device? 发生了什么事,还是您只是在设备上什么都没有看到?
  • Ensure that UIApplication.SharedApplication.CanOpenUrl(fileUrl); 确保UIApplication.SharedApplication.CanOpenUrl(fileUrl); returns true 返回true
  • Did you specify the correct values (eg bundle identifier etc.) in the manifest file ( TruckApp.iOS.plist )? 您是否在清单文件( TruckApp.iOS.plist )中指定了正确的值(例如,捆绑包标识符等)?
  • Check on the web server if the manifest / .ipa is being accessed (eg downloaded) 在Web服务器上检查清单.ipa是否正在访问(例如下载)
  • Does the web server return the correct content type for the .ipa type - it is supposed to be application/octet-stream . Web服务器是否为.ipa类型返回正确的内容类型-它应该是application/octet-stream If you are using Microsoft IIS, it sometimes "misbehaves" 如果您使用的是Microsoft IIS,则有时“行为不当”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM