美文网首页
iOS 自定义服务器下载安装ipa流程

iOS 自定义服务器下载安装ipa流程

作者: Evans_Xiao | 来源:发表于2018-06-28 13:42 被阅读114次
一、在码云https://gitee.com上新建一个项目,并命名testApp,需要注意的是一定要是public模式,得到工程仓库:https://gitee.com/1019459067/testApp
二、新建iOS测试工程项目,并命名testApp
三、将iOS项目打包,注意:这里为了测试方便,一定要采用Apple官方的打包模式.在进行到导出ipa的时候,进行到下一步时:
01-01.png

需要将图示部分选中,为了导出manifest.plist文件

四、点击Next,接下来出现如下界面
01-02.png

因plist的链接要求一定是https的,而且必须是公网ssl.所以暂时填写之前仓库的地址,后续可以更新的. 在网上听说自签名及免费的https不可用,这里楼主没有做测试,其实还是有的,只是屡战屡败而已~~~

五、最后到处ipa,得到如下内容:
01-03.png

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>https://gitee.com/1019459067/testApp</string>
                </dict>
                <dict>
                    <key>kind</key>
                    <string>display-image</string>
                    <key>url</key>
                    <string>https://gitee.com/1019459067/testApp</string>
                </dict>
                <dict>
                    <key>kind</key>
                    <string>full-size-image</string>
                    <key>url</key>
                    <string>https://gitee.com/1019459067/testApp</string>
                </dict>
            </array>
            <key>metadata</key>
            <dict>
                <key>bundle-identifier</key>
                <string>com.xwh.testApp</string>
                <key>bundle-version</key>
                <string>1.0</string>
                <key>kind</key>
                <string>software</string>
                <key>title</key>
                <string>testApp</string>
            </dict>
        </dict>
    </array>
</dict>
</plist>

六、接下来,将得到的manifest.plist上传至仓库

git命令:

git add -A
git commit -m "testApp"
git push
七、获取manifest.plist下载链接:
01-04.png 01-05.png 01-06.png

获取地址:https://gitee.com/1019459067/testApp/raw/master/manifest.plist,这个地址在下载ipa时会用到,而且非常重要!!!后续要用到

八、在自己Mac电脑上搭建Apache服务器,此处可自行网上寻找教程

在目录下/Library/WebServer/Documents新建文件夹testApp

  • 1、将iOS工程导出的ipa放入 文件夹testApp

  • 2、在文件夹testApp中新建index.html

    index.html中的内容如下:

<body>
    <p class="title top-space" style="font-size: 50; text-align: center;">testApp</p> 
    
    <p class="download_content top-space" style="text-align: center;">  
        <a class="download_btn" style="font-size: 45; text-align: center;" href="itms-services://?action=download-manifest&url=https://gitee.com/1019459067/testApp/raw/master/manifest.plist">download</a>
    </p>  
</body>  

效果图如下:

01-09.png
九、获取testApp.ipa下载链接

根据第8步可以获取testApp.ipa地址为:http://172.20.108.15/testApp/testApp.ipa

十、更新仓库中manifest.plist的内容

将第8步中的 http://172.20.108.15/testApp/testApp.ipa 更新到

<dict>
    <key>kind</key>
    <string>software-package</string>
    <key>url</key>
    <string>http://172.20.108.15/testApp/testApp.ipa</string>
</dict>

注: manifest.plist中的图片可以自行更新.

十一、可以进行App下载了.在手机浏览器上访问

http://172.20.108.15/testApp/index.html

01-10.PNG

------------恭喜已经完成了整个教程!!!去浪你个儿浪吧------------

相关文章

网友评论

      本文标题:iOS 自定义服务器下载安装ipa流程

      本文链接:https://www.haomeiwen.com/subject/inegyftx.html