1. 打好企业包
2. 编辑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>
<!-- 需要安装的ipa包在服务器的路径 -->
<string>https://www.example.cn/ipa/mytest/Mytest.ipa</string>
</dict>
<dict>
<key>kind</key>
<string>full-size-image</string>
<key>needs-shine</key>
<true/>
<key>url</key>
<!-- 安装时需要显示的大图标(1024*1024)在服务器的路径 -->
<string>https://www.example.cn/ipa/mytest/icon_full_size_s.png</string>
</dict>
<dict>
<key>kind</key>
<string>display-image</string>
<key>needs-shine</key>
<true/>
<key>url</key>
<!-- 安装时需要显示的小图标(180*180)在服务器的路径 -->
<string>https://www.example.cn/ipa/mytest/icon_display_s.png</string>
</dict>
</array>
<key>metadata</key>
<dict>
<key>bundle-identifier</key>
<string>com.mcrazy.Mytest</string>
<key>bundle-version</key>
<string>1.1.4</string>
<key>kind</key>
<string>software</string>
<key>title</key>
<string>测试客户端</string>
</dict>
</dict>
</array>
</dict>
</plist>
3. 将ipa包和plist文件和png文件放在可访问目录里(plist文件访问时必须要https)
4. 编辑plist文件,使.ipa 和 png 链接对应
5. 访问
用safari浏览器访问
itms-services:///?action=download-manifest&url=https://XXX.com/balabala.plist
6. 美化操作
可以写一个网页发布出来,然后通过点击安装(主要为了解决微信分享需要跳转safari问题):
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
<meta charset="UTF-8">
<title>Ad Hoc .ipa在线安装</title>
<style>
*{
margin: 0px;
padding: 0px;
}
.download_div{
width: 100%;
height: 100%;
text-align: center;
font-weight: bold;
/*background: -webkit-gradient(linear,0 0,0 bottom,from(#dbeae0),to(hsla(0,0%,100%,.6)));*/
font-size: 2em;
}
.download_title{
padding-top: 1em;
padding-bottom: 1em;
/*background-color: #d7e2f7;*/
background: -webkit-gradient(linear, left top, left bottom, from(#d7e2f7), to(#ffffff));
}
.img_app_overview {
width: 100%;
height: 480px;
display: block;
}
.download_button{
/*margin-top: -0.3em;*/
background: -webkit-gradient(linear,left top,left bottom,from(#879ee3), to(#ffffff));
width: 100%;
}
.button{
/*margin-top: 5em;*/
margin-left: 0.8em;
display: inline-block;
outline: none;
cursor: pointer;
text-align: center;
text-decoration: none;
font: 14px/100% Arial, Helvetica, sans-serif;
padding: .5em 2em .55em;
text-shadow: 0 1px 1px rgba(0,0,0,.3);
-webkit-border-radius: .5em;
-moz-border-radius: .5em;
border-radius: .5em;
-webkit-box-shadow: 0 1px 2px rgba(0,0,0,.2);
-moz-box-shadow: 0 1px 2px rgba(0,0,0,.2);
box-shadow: 0 1px 2px rgba(0,0,0,.2);
color:#fff;
}
.button_green{
background: #c8dd95;
background: -webkit-gradient(linear, left top, left bottom, from(#7a71d0), to(#ffffff) );
background: -moz-linear-gradient(-90deg, #7a71d0, #ffffff);
}
.download_tips{
font-size: 0.5em;
margin-top: 1em;
font-weight: normal;
margin-top: 3em;
}
.button_top{
margin-top: 3em;
}
a:hover, a:visited, a:link, a:active {
text-decoration: none;
color: #fff;
}
/*mobile*/
@media screen and (max-width: 1199px){
.img_app_overview {
width: 100%;
height: 250px;
display: block;
}
}
</style>
</head>
<body>
<div class="download_div">
<p class="download_title">测试安装包v1.1.4</p>
<img class="img_app_overview" src="img_app_overview.png" alt="Mr.chao">
<div class="download_button">
<button class="button button_green button_top" onclick="downloadClientApp();"><a href="javascript:void(0);">点击安装app</a></button>
<!-- <button class="button button_green button_top"><a href="{{androidAUrl}}">Android客户端下载</a></button> -->
<div class="download_tips">
<strong>微信扫描</strong>下载,<strong>请点击右上角</strong>,<br />选择“<strong>在浏览器中打开</strong>”即可安装下载
</div>
</div>
</div>
<script>
var downloadClientApp = function() {
// 在此用到配置文件(Mytest.plist)的外部链接
window.location.href='itms-services:///?action=download-manifest&url=https://www.example.cn/ipa/mytest/Mytest.plist';
}
</script>
</body>
</html>