1.需要一個(gè)html文件,引導(dǎo)下載用戶(hù)在線(xiàn)安裝ipa
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>一鍵安裝掌上綜調(diào)iPhone版</title>
</head>
<body>
<a href='itms-services://?action=download-manifest&url=http://222.177.4.242/ios/d.plist'>一鍵安裝掌上綜調(diào)iPhone版</a>
</body>
</html>
2. 上文中的d.plist文件內(nèi)容如下,其實(shí)它是一個(gè)XML文件,有關(guān)plist文件,請(qǐng)自行查閱google
<?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>http://222.177.4.242/download?attachId=022DB5EAF88A57B175D24060DCD1BA70</string>
</dict>
<dict>
<key>kind</key>
<string>display-image</string>
<key>needs-shine</key>
<true/>
<key>url</key>
<string>http://222.177.4.242/ios/icon.png</string>
</dict>
<dict>
<key>kind</key>
<string>full-size-image</string>
<key>needs-shine</key>
<true/>
<key>url</key>
<string>http://222.177.4.242/ios/icon.png</string>
</dict>
</array><key>metadata</key>
<dict>
<key>bundle-identifier</key>
<string>com.ccssoft.mopclient.chongqing</string>
<key>bundle-version</key>
<string>1.0.0</string>
<key>kind</key>
<string>software</string>
<key>subtitle</key>
<string>掌上綜調(diào)</string>
<key>title</key>
<string>掌上綜調(diào)</string>
</dict>
</dict>
</array>
</dict>
</plist>
上面2中的http://222.177.4.242/download?attachId=022DB5EAF88A57B175D24060DCD1BA70 這是ipa包所在的網(wǎng)絡(luò)地址
3.自行找一個(gè)icon.png放在上面兩個(gè)文件的同一個(gè)目錄,此圖片用作在iphone上顯示程序圖標(biāo)。 http://222.177.4.242/ios/icon.png
4.使用iphone safari瀏覽器,瀏覽http://222.177.4.242/ios/d.html文件,即可安裝了。簡(jiǎn)單吧。
iOS 7.1下itms-services在線(xiàn)安裝失敗的解決方法
iOS 7.1正式版發(fā)布了,之前使用itms-services://URL方式在線(xiàn)安裝ipa文件的方法卻失效了,點(diǎn)擊的時(shí)候報(bào)錯(cuò)為:“無(wú)法安裝應(yīng)用程序,因xxx.com的證書(shū)無(wú)效”,這應(yīng)該怎么解決呢?
其實(shí)iOS 7.1修改了manifest.plist文件的訪問(wèn)協(xié)議,之前可以通過(guò)http協(xié)議訪問(wèn),在iOS 7.1之后必須使用https協(xié)議方式訪問(wèn)。
比如之前的鏈接代碼為:
itms-services://?action=download-manifest&url=http://example.com/manifest.plist
在iOS 7.1之后,就需要修改為:
itms-services://?action=download-manifest&url=https://example.com/manifest.plist
需要一個(gè)SSL證書(shū)才能夠?qū)崿F(xiàn)在線(xiàn)安裝ipa文件的功能。
//------------------- 延伸: 關(guān)于https設(shè)置 ----------------------------------
1.upload your app.plist to dropbox
2.get shared link of app.plist, like https://www.dropbox.com/s/qgknrfngaxazm38/app.plist
3.replace www.dropbox.com with dl.dropboxusercontent.com in the link, like https://dl.dropboxusercontent.com/s/qgknrfngaxazm38/app.plist
4.write your download.html like <a href="itms-services://?action=download-manifest&url=https://dl.dropboxusercontent.com/s/qgknrfngaxazm38/app.plist">INSTALL!!</a>
5.upload the download.html to dropbox
6.get shared link of download.html, like https://www.dropbox.com/s/gnoctp7n9g0l3hx/download.html
7.replace www.dropbox.com with dl.dropboxusercontent.com in the second link as well, like https://dl.dropboxusercontent.com/s/gnoctp7n9g0l3hx/download.html
Now, visit https://dl.dropboxusercontent.com/s/gnoctp7n9g0l3hx/download.html in your device, you can install the app like before.
這個(gè)是通過(guò)上傳dropbox來(lái)解決,事實(shí)上,只要找個(gè)可以以https方式共享外鏈的網(wǎng)盤(pán),把plist文件上傳就可以了!
上述方法通過(guò)測(cè)試可以解決提示“證書(shū)無(wú)效”的問(wèn)題。下面介紹下步驟:
1、進(jìn)入dropbox注冊(cè)一個(gè)賬號(hào):https://www.dropbox.com/ ,并根據(jù)官網(wǎng)提示安裝dropbox
2、安裝成功后會(huì)自動(dòng)在桌面上的名為用戶(hù)名的文件夾(WIN7)建立一個(gè)名為Dropbox的文件夾。將之前做好的plist文件復(fù)制到此文件夾中
3、plist文件左下角有藍(lán)色圖標(biāo)表示正在同步,變?yōu)榫G色圖標(biāo)表示完成同步。在plist文件上點(diǎn)擊右鍵,選擇“共享Dropbox鏈接”,會(huì)在狀態(tài)欄中提示已復(fù)制到剪貼板
4、在記事本中粘貼出來(lái),鏈接地址應(yīng)為類(lèi)似于:https://www.dropbox.com/s/qgknrfngaxazm38/app.plist
5、將這個(gè)鏈接中www.dropbox.com替換為dl.dropboxusercontent.com,結(jié)果類(lèi)似于:https://dl.dropboxusercontent.com/s/qgknrfngaxazm38/app.plist
6、把這個(gè)鏈接替換itms:services://后url的參數(shù),類(lèi)似于:<a href="itms-services://?action=download-manifest&url=https://dl.dropboxusercontent.com/s/qgknrfngaxazm38/app.plist">INSTALL!!</a>
完畢。