1.需要一个html文件,引导下载用户在线安装ipa
<!
DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
>
<
html
>
<
head
>
<
title
>一键安装掌上综调iPhone版
</
title
>
</
head
>
<
body
>
<
a
href
='itms-services://?action=download-manifest&url=http://222.177.4.242/ios/d.plist'
>一键安装掌上综调iPhone版
</
a
>
</
body
>
</
html
>
2. 上文中的d.plist文件内容如下,其实它是一个XML文件,有关plist文件,请自行查阅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
>掌上综调
</
string
>
<
key
>title
</
key
>
<
string
>掌上综调
</
string
>
</
dict
>
</
dict
>
</
array
>
</
dict
>
</
plist
>
上面2中的http://222.177.4.242/download?attachId=022DB5EAF88A57B175D24060DCD1BA70 这是ipa包所在的网络地址
3.自行找一个icon.png放在上面两个文件的同一个目录,此图片用作在iphone上显示程序图标。 http://222.177.4.242/ios/icon.png
4.使用iphone safari浏览器,浏览http://222.177.4.242/ios/d.html文件,即可安装了。简单吧。
iOS 7.1下itms-services在线安装失败的解决方法
iOS 7.1正式版发布了,之前使用itms-services://URL方式在线安装ipa文件的方法却失效了,点击的时候报错为:“无法安装应用程序,因xxx.com的证书无效”,这应该怎么解决呢?
其实iOS 7.1修改了manifest.plist文件的访问协议,之前可以通过http协议访问,在iOS 7.1之后必须使用https协议方式访问。
比如之前的链接代码为:
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
需要一个SSL证书才能够实现在线安装ipa文件的功能。
//------------------- 延伸: 关于https设置 ----------------------------------
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.
这个是通过上传dropbox来解决,事实上,只要找个可以以https方式共享外链的网盘,把plist文件上传就可以了!
上述方法通过测试可以解决提示“证书无效”的问题。下面介绍下步骤:
1、进入dropbox注册一个账号:https://www.dropbox.com/ ,并根据官网提示安装dropbox
2、安装成功后会自动在桌面上的名为用户名的文件夹(WIN7)建立一个名为Dropbox的文件夹。将之前做好的plist文件复制到此文件夹中
3、plist文件左下角有蓝色图标表示正在同步,变为绿色图标表示完成同步。在plist文件上点击右键,选择“共享Dropbox链接”,会在状态栏中提示已复制到剪贴板
4、在记事本中粘贴出来,链接地址应为类似于:https://www.dropbox.com/s/qgknrfngaxazm38/app.plist
5、将这个链接中www.dropbox.com替换为dl.dropboxusercontent.com,结果类似于:https://dl.dropboxusercontent.com/s/qgknrfngaxazm38/app.plist
6、把这个链接替换itms:services://后url的参数,类似于:<a href="itms-services://?action=download-manifest&url=https://dl.dropboxusercontent.com/s/qgknrfngaxazm38/app.plist">INSTALL!!</a>
完毕。