iOS 基于 itemServices 进行本地安装 ipa 应用安装包

itemServices 协议

itemServices 是苹果推出的一款协议.基于这款协议,我们在本地部署一个服务器,将 ipa 包存放到本地服务器.然后,测试人员只要通过 iOS 测试设备的 Safari 浏览器访问特定的地址,就可以通过内网更新 app

简单实现

1.准备工作

在进行功能实现以前,我们需要了解以下的准备内容

项目打包后的文件,使用企业分发方式打出的一个 xxx.ipa 包(如果选择 Development, 则只能使用注册过的设备进行内测,如果选择 EnterPrise 打包的话,不仅可以内测,还可以提供给外部人员使用);
一个 xxx.plist 文件,内容如下,生成成功以后使用 Xcode 查看是否能够成功打开;

<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
    <array>
        <array>
            <dict>
                <key>assets</key>
                <array>
                    <dict>
                        <key>kind</key>
                        <string>software-package</string>
                        <key>url</key>
                        <string>https://ipa.xxxx.com/20190531/xxxx.ipa</string>
                    </dict>
                    <dict>
                        <key>kind</key>
                        <string>full-size-image</string>
                        <key>needs-shine</key>
                        <true/>
                        <key>url</key>
                        <string>https://kaig.chuangkegf.com/profile/down_image_57.png</string>
                    </dict>
                    <dict>
                        <key>kind</key>
                        <string>display-image</string>
                        <key>needs-shine</key>
                        <true/>
                        <key>url</key>
                        <string>https://kaig.chuangkegf.com/profile/down_image_512.png</string>
                    </dict>
                </array>
                <key>metadata</key>
                <dict>
                    <key>title</key>
                    <string>惠普众联</string>
                    <key>bundle-version</key>
                    <string>版本号</string>
                    <key>kind</key>
                    <string>software</string>
                    <key>bundle-identifier</key>
                    <string>com.wanshang.WuHanLoan(app 的 bundleID)</string>
                </dict>
            </dict>
        </array>
    </array>
</plist>

2.把IPA包和plist文件放到自己的服务器(https://)。

3.生成一个访问plist文件的地址,在Safari上打开即可。

itms-services://?action=download-manifest&url=https://www.xxx.com/20190530/xxxx.plist
<a href="itms-services://?action=download-manifest&url=https://www.xxx.com/20190530/xxxx.plist">下载安装</a>

PS:

https://blog.csdn.net/weixin_34290000/article/details/87141847

https://www.jianshu.com/p/550545eb505f

猜你喜欢

转载自www.cnblogs.com/phpdragon/p/10957193.html
今日推荐