我需要从URL直接下载和安装一个ipa
文件。
我已经尝试过这个方法:
NSURL *url = [NSURL URLWithString:@"https://myWeb.com/test.ipa"];
[[UIApplication sharedApplication] openURL:url];
这个应用程序会启动Safari,但随后出现以下错误消息:
这是可能的吗?
我需要从URL直接下载和安装一个ipa
文件。
我已经尝试过这个方法:
NSURL *url = [NSURL URLWithString:@"https://myWeb.com/test.ipa"];
[[UIApplication sharedApplication] openURL:url];
这个应用程序会启动Safari,但随后出现以下错误消息:
这是可能的吗?
为了通过空中分发(OTA,这意味着不使用TestFlight或正式的App Store)发布您的应用程序,您可能需要创建3个不同的文件,分别是:
有关更多信息,请参见https://support.apple.com/en-gb/guide/deployment/depce7cefc4d/web。
您可以寻找服务来为您生成这些文件,也可以手动完成。
index.html
<a href="itms-services://?action=download-manifest&url=https://myWeb.com/MY_TEST_APP/manifest.plist">安装应用</a>
manifest.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>items</key>
<array>
<dict>
<key>assets</key>
<array>
<dict>
<key>kind</key>
<string>software-package</string>
<key>url</key>
<string>http://YOUR_SERVER_URL/YOUR-IPA-FILE.ipa</string>
</dict>
</array>
<key>metadata</key>
<dict>
<key>bundle-identifier</key>
<string>com.yourCompany.productName</string>
<key>bundle-version</key>
<string>1.0.0</string>
<key>kind</key>
<string>software</string>
<key>title</key>
<string>YOUR APP NAME</string>
</dict>
</dict>
</array>
</dict>
</plist>
如果应用程序无法安装或运行,您可能需要检查以下项目:
index.html
和manifest.plist
中的URLplist
文件可能需要托管在HTTPS服务器上。如果需要,您可以使用Dropbox。index.html
的示例。希望这样可以。 - Simon East是的,Safari会检测到*.ipa文件并尝试安装它,但必须正确签名,只有通过授权的设备才能安装。
http://www.diawi.com是一个可以帮助你完成这个过程的服务。
所有这些都是针对Ad-hoc分发,而不是用于生产应用程序。
更多信息请查看下面的链接: 有没有一种通过浏览器安装iPhone应用程序的方法?
勾选“包含清单plist复选框”,并提供所需链接,导出.ipa文件。
将.ipa文件和.plist文件上传到服务器的同一位置(在导出.ipa时提供/在.plist文件中提到的位置)。
按以下方式创建下载链接。URL应链接到您的.plist文件位置。
itms-services://?action=download-manifest&url=https://yourdomainname.com/app.plist
将此链接复制并粘贴到iPhone的Safari浏览器中。它会要求您安装 :D
使用此完整URL创建html按钮
有在线工具可以简化这个分享过程,例如https://abbashare.com或https://diawi.com。使用adhoc或inhouse profile从xcode创建ipa文件,然后将此文件上传到这些网站中。我更喜欢使用abbashare,因为它可以将文件保存在您的Dropbox中,并且您可以随时删除它。
NSString *urlString = // url string where your manifest.plist is deployed on your server.
NSURL *installationURL = [NSURL URLWithString:[NSString stringWithFormat:@"itms-services://?action=download-manifest&url=%@",[urlString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]];
[[UIApplication sharedApplication] openURL];
现在有更多新的工具可用,具有更多新功能来分发甚至管理您的项目和应用程序(ipa和apk),在我看来https://appforshare.io是最近的新工具,除了分发 ad-hoc 或开发构建之外,还有很多其他功能。
NSURL *url = [NSURL URLWithString:@"itms-services://?action=download-manifest&url=https://xxxxxx.com/rest/images/apps/ipa/dev/xyz.plist"]];
[[UIApplication sharedApplication] openURL:url];
openUrl方法已经弃用。
[[UIApplication sharedApplication] openURL: url options:@{} completionHandler:nil];
这个方法latest会打开openUrl方法并显示提示对话框。对话框将显示
xxxxxx.com想要安装“YOUR_APP_NAME”
这条消息。如果您点击“安装”按钮,应用程序将关闭并下载ipa。