使用Github發(fā)布iOS應(yīng)用(OTA)

OTA (Over The Air)是蘋果很早就支持的功能,目的是讓企業(yè)用戶脫離Appstore通過網(wǎng)頁來發(fā)布app,想要實(shí)現(xiàn)OTA發(fā)布,首頁要購買一個企業(yè)證書,價(jià)格是$299/年。申請企業(yè)證書:https://developer.apple.com/programs/enterprise/

發(fā)布流程如下:

1,使用Xcode生成ipa安裝包

  • 首先在TARGETS的General配置中,將Bundle Identifier設(shè)置為該企業(yè)帳號對應(yīng)的App ID,如com.baidu.XXX;
  • 然后在Build Setting的Code signing一欄,選擇企業(yè)帳號對應(yīng)的Distribution證書;
  • 接下來選擇Xcode->Product->Archive,即可開始打包了。
  • 生成xcarchive,接下來Export時(shí),需要選擇Save for Enterprise Deployment一項(xiàng),點(diǎn)擊next即可導(dǎo)出ipa文件了。
Enterprise

2,將ipa、plist、html文件、icon上傳至新建的根目錄

首先新建一個空白的github倉庫,將打包好的ipa文件及空白install.plist、install.html文件及app Icon圖片上傳至倉庫根目錄。這樣就有了每個文件在github上的鏈接地址。

然后配置install.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://***/XXX.ipa</string>
              </dict> 
                             
              <dict>
                    <key>kind</key>
                    <string>display-image</string>
                    <key>needs-shine</key>
                    <true/>
                    <key>url</key>
                    <string>https://***/Icon57.png</string>
                </dict>

                <dict>
                    <key>kind</key>
                    <string>full-size-image</string>
                    <key>needs-shine</key>
                    <true/>
                    <key>url</key>
                    <string>https://***/Icon57.png</string>
                </dict>
           </array>
            
            <key>metadata</key>
            
            <dict>
                <key>bundle-identifier</key>
                <string>com.baidu.***</string>
                <key>bundle-version</key>
                <string>1.0.0</string>
                <key>kind</key>
                <string>software</string>
                <key>title</key>
                <string>Hiclub</string>
            </dict>
            
        </dict>
    </array>
</dict>
</plist>

pist文件中需要注意:

  • software-package對應(yīng)的鏈接即github上ipa文件所在地址
  • display-image為安裝過程中iphone桌面上顯示的圖標(biāo)
  • bundle-identifier為打包ipa中所配置的id
  • bundle-version為當(dāng)前app版本

3,配置install.html文件,用來生成安裝頁

<!DOCTYPE HTML>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <title>Install</title>
    </head>
    <body>
        <p align=center>
          <font size="10">
            <a style="color:#69DEDA" href="itms-services://?action=download-manifest&url=***/install.plist">點(diǎn)擊安裝</a>
          </font>
        </p>
    </body>
</html>

install.plist即為該文件在github上的鏈接地址,然后將全部文件push到github。

4,生成在線安裝鏈接

htmlpreview

由于github上的安裝頁面install.html無法直接預(yù)覽,通過一個非常使用的小工具htmlpreview,將install.html原鏈接轉(zhuǎn)換為可預(yù)覽的鏈接,如上圖所示。最后用iPhone Safari 打開新生成的鏈接就可以安裝了。

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容