標籤:
本文轉載至 http://mobile.51cto.com/hot-439095.htm
通過itms-services協議,可以通過safari瀏覽器直接在iOS裝置上安裝應用程式。利用這種方式,只要在內網布置一個伺服器,測試人員只需要通過測試裝置的safari瀏覽器訪問特定的url既可以實現安裝,然後測試了。
AD:WOT2015 互連網營運與開發人員大會 熱銷搶票
通過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檔案範例如下:
- <?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>ipa包的,如:http://www.tammy.com:450/static/ios/(targetname)_(version)_build(buildversion)_yyyyMMdd.ipa</string>
- </dict>
- </array>
- <key>metadata</key>
- <dict>
- <key>bundle-identifier</key>
- <string>應用程式中的<span style="font-family:FangSong_GB2312">bundle-identifier</span><span style="font-family:FangSong_GB2312"></string></span>
- <key>bundle-version</key>
- <string>版本號碼</string>
- <key>kind</key>
- <string>software</string>
- <key>subtitle</key>
- <string>子標題</string>
- <key>title</key>
- <string>軟體名稱</string>
- </dict>
- </dict>
- </array>
- </dict>
- </plist>
html檔案範例如下:
- <span style="font-size:12px"><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <meta http-equiv="Content-Style-Type" content="text/css">
- <title>測試包安裝</title>
- </head>
- <body>
- <br>
- <div style="position:absolute;left:200px" width=400><a href="../index.html">返回</a></div>
- <h1 align="center">開發版(TRUNK)</h1>
- <table align="center" border=1 width=400>
- <tr height=60>
- <th colspan=2><h2>標題</h2></th>
- </tr>
- <tr height=60 align="center">
- <td width=200><a 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">
- <td width=200><a 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
不通過AppStore,在iOS裝置上直接安裝應用程式的原理