IOS 不通過appStore分發應用(企業賬號)個人賬號只能限制100台,並且需要將設備綁定


通過itms-services協議,可以通過safari瀏覽器直接在iOS設備上安裝應用程序。利用這種方式,只要在內網布置一個服務器,測試人員只需要通過測試設備的safari瀏覽器訪問特定的url既可以實現安裝,然后測試了。(PS:越獄設備也可以)

itms- services協議需要一個plist配置文件。如果要實現上面圖示的功能,需要的文件有:一個ipa文件,一個plist文件,一個html文件和一 個圖片文件。其中,最主要的,就是plist文件。通過shell腳本,我們可以讓其自動為我們生成plist文件和html文件,並且在xcode工程 中的ipa文件和程序圖標文件復制一份,放到一起。

《xcode自動打ipa包腳本》學習地址:http://webfrogs.me/2012/09/19/buildipa/

plist文件范例如下:

  1. <?xml version="1.0" encoding="UTF-8"?>   
  2. <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">   
  3. <plist version="1.0">   
  4. <dict>   
  5.    <key>items</key>   
  6.    <array>   
  7.        <dict>   
  8.            <key>assets</key>   
  9.            <array>   
  10.                <dict>   
  11.                    <key>kind</key>   
  12.                    <string>software-package</string>   
  13.                    <key>url</key>   
  14.                    <string>ipa包的下載地址,如:http://www.tammy.com:450/static/ios/(targetname)_(version)_build(buildversion)_yyyyMMdd.ipa</string>   
  15.                </dict>   
  16.            </array>   
  17.            <key>metadata</key>   
  18.            <dict>   
  19.                <key>bundle-identifier</key>   
  20.                <string>應用程序中的<span style="font-family:FangSong_GB2312">bundle-identifier</span><span style="font-family:FangSong_GB2312"></string></span>   
  21.                <key>bundle-version</key>   
  22.                <string>版本號</string>   
  23.                <key>kind</key>   
  24.                <string>software</string>   
  25.                <key>subtitle</key>   
  26.                <string>子標題</string>   
  27.                <key>title</key>   
  28.                <string>軟件名稱</string>   
  29.            </dict>   
  30.        </dict>   
  31.    </array>   
  32. </dict>   
  33. </plist>   

html文件范例如下:

  1. <span style="font-size:12px"><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">   
  2. <html>   
  3. <head>   
  4.   <meta http-equiv="Content-Type" content="text/html; charset=utf-8">   
  5.   <meta http-equiv="Content-Style-Type" content="text/css">   
  6.   <title>測試包安裝</title>   
  7. </head>   
  8. <body>   
  9. <br>   
  10. <div style="position:absolute;left:200px" width=400><href="../index.html">返回</a></div>   
  11.     <h1 align="center">開發版(TRUNK)</h1>   
  12.     <table align="center" border=width=400>   
  13.     <tr height=60>   
  14.         <th colspan=2><h2>標題</h2></th>   
  15.     </tr>   
  16.     <tr height=60 align="center">   
  17.         <td width=200><href="itms-services://?action=download-manifest&url=</span><span style="font-size:10px"><span style="font-family:FangSong_GB2312">http://www.tammy.com:450/static/ios/****.plist</span><span style="font-family:FangSong_GB2312">"><h2>Install</h2></a></td></span></span><span style="font-size:12px">   
  18.         <td width=200><href="</span><pre name="code" class="html" style="color:rgb(34,34,34); line-height:22px">http://www.tammy.com:450/static/ios/(targetname)_(version)_build(buildversion)_yyyyMMdd.ipa</pre>"><h2>Download</h2></a></td></tr>    </table><br></body></html

不通過App Store,直接安裝應用程序的實現步驟:

1、設置簽名

利用developer profile或者adhoc distribution profile簽名app,注意,不能使用distribution profile方式簽名;個人開發者證書只能在100個設備中實現無線安裝。

2、生成arichive

菜單:product->archive,完成后可以在organizer中看到生成的arichive。

3、生成ipa

選擇剛剛生成的arichive,點擊“Distribute...",彈出如下圖界面,選擇第二個,點“next”,設置相關參數,一 定要勾選“save for enterprise distribution”。application url,是生成的ipa在服務器的位置;title是安裝過程中出現的標題;large image url 和 smal image url是安裝過程中出現的圖標。點擊保存,將生成兩個文件:***.ipa和***.plist。

4、服務器部署

將生成的***.ipa和***.plist文件部署到服務器,同時在服務器生成一個html文件,目的是點擊后打開一個鏈接,這樣ios設備就會執行指令自動安裝app了。要打開的鏈接內容如下:

itms-services://?action=download-manifest&url=http://www.tammy.com:450/static/ios/****.plist


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM