前言 本人公司开发的.ipa 发布于 AppStore 和自己的服务器上。但是自己却一直没时间利用公司的资源进行研究。现在赶紧趁热打铁,记录一下,以便以后查阅。 在此之前,在网上查阅了相关资料并整理了一下加以完善更正。 背景 网上说Xcode 6 之后版本导出企业.ipa 包需要手动添加.plist 文件,本人今天亲自测试了一遍,发现Xcode 7 之后又可以配置生成的。在这里我按照我的流程走一遍。 IPA打包
- 在工程中选择
Product -Archive 进入打包界面 - 选择
Export 进入打包方式选择界面 -
选择Save for Enterprise Deployment 选项,Next ![打包方式](http://image89.360doc.com/DownloadImg/2015/10/1022/60055319_1.jpg) -
选择对应的企业账号,然后继续即可 ![选择开发者账号](http://image89.360doc.com/DownloadImg/2015/10/1022/60055319_2.jpg) -
接下来是对安装设备的要求选择,默认选择所有设备。第二个选项是指定特定类型设备方可安装。我们使用默认第一项,Next ![安装设备要求](http://image89.360doc.com/DownloadImg/2015/10/1022/60055319_3.jpg) -
之后的界面是对应用的二次确认,确保APP配置准确无误。在窗口的左下方有一个Include manifest for over-the-air installation 。该选项表示是否在生成.ipa 文件的同时生成.plist 文件,我们勾选上,Next ![确认配置](http://image89.360doc.com/DownloadImg/2015/10/1022/60055319_4.jpg)
over-the-air : OTA 是苹果在iOS4 中新增的一项功能,目的是让企业用户能够在脱离Apple App Store 的情况下通过网页无线发布 iOS 应用;简单来讲就是在Safari 中点击一个链接就可以在iPhone或iPad上下载并安装应用(目前很多越狱软件都是使用的这种发布方式)。
-
接下来配置.plist 文件,填写完之后,Export导出.ipa 包和相应的.plist 文件(建议将生成的.plist 文件命名同APP名一致,方面后期管理) ![配置plist文件](http://image89.360doc.com/DownloadImg/2015/10/1022/60055319_5.jpg) 构建网站 必备条件
步骤
- 将
.plist 文件与.ipa 文件上传至服务器供用户访问 -
创建一个包含如下代码的网页,用户轻点 Web 链接后会下载.plist 文件,并触发下载和安装 以下是示例链接:
1
| <a href="itms-services://?action=download-manifest&url=https://example.com/manifest.plist">Install App</a>
| -
配置服务器MIME 类型 您可能需要配置 Web 服务器,让.plist 文件和.ipa 文件可正确传输。
对于OS X Server ,请将MIME 类型添加到 Web 服务的MIME 类型设置:
- application/octet-stream ipa
- text/xml plist
对于微软的互联网信息服务器 (IIS),请使用IIS Manager 在服务器的“属性”页面中添加MIME 类型:
- .ipa application/octet-stream
- .plist text/xml
【警告】撤销分发证书会导致使用该证书签名的所有应用失效。只有万不得已时才应撤销证书,比如确定专用密钥已丢失或确信证书已遭破解。
拓展区 关于无线清单文件(.plist文件) 清单文件是一个XML plist 文件 ,可供 Apple 设备用来从您的 Web 服务器上查找、下载和安装应用。清单文件由 Xcode 创建,使用的是您在共享用于企业分发的归档应用时所提供的信息。 以下栏是必填项:
-
URL :应用 (.ipa) 文件的完全限定 HTTPS URL -
display-image :57 x 57 像素的 PNG 图像,在下载和安装过程中显示。指定图像的完全限定 URL -
full-size-image :512 x 512 像素的 PNG 图像,表示 iTunes 中相应的应用 -
bundle-identifier :应用的包标识符,与 Xcode 项目中指定的完全一样 -
bundle-version :应用的包版本,在 Xcode 项目中指定 -
title :下载和安装过程中显示的应用的名称 样本清单文件(下面给出)还包含可选键。例如,如果应用文件太大,并且想要在执行错误检验(TCP 通信通常会执行该检验)的基础上确保下载的完整性,可以使用 MD5 键。 通过指定项目数组的附加成员,您可以使用一个清单文件安装多个应用。 示例 iOS 应用清单文件
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<!-- array of downloads.-->
<key>items</key>
<array>
<dict>
<!-- an array of assets to download -->
<key>assets</key>
<array>
<!-- software-package: the ipa to install.-->
<dict>
<!-- required. the asset kind.-->
<key>kind</key>
<string>software-package</string>
<!-- optional. md5 every n bytes. will restart a chunk if md5 fails.-->
<key>md5-size</key>
<integer>10485760</integer>
<!-- optional. array of md5 hashes for each "md5-size" sized chunk.-->
<key>md5s</key>
<array>
<string>41fa64bb7a7cae5a46bfb45821ac8bba</string>
<string>51fa64bb7a7cae5a46bfb45821ac8bba</string>
</array>
<!-- required. the URL of the file to download.-->
<key>url</key>
<string>https://www.example.com/apps/foo.ipa</string>
</dict>
<!-- display-image: the icon to display during download.-->
<dict>
<key>kind</key>
<string>display-image</string>
<!-- optional. indicates if icon needs shine effect applied.-->
<key>needs-shine</key>
<true/>
<key>url</key>
<string>https://www.example.com/image.57x57.png</string>
</dict>
<!-- full-size-image: the large 512x512 icon used by iTunes.-->
<dict>
<key>kind</key>
<string>full-size-image</string>
<!-- optional. one md5 hash for the entire file.-->
<key>md5</key>
<string>61fa64bb7a7cae5a46bfb45821ac8bba</string>
<key>needs-shine</key>
<true/>
<key>url</key><string>https://www.example.com/image.512x512.jpg</string>
</dict>
</array>
<key>metadata</key>
<dict>
<!-- required -->
<key>bundle-identifier</key>
<string>com.example.fooapp</string>
<!-- optional (software only) -->
<key>bundle-version</key>
<string>1.0</string>
<!-- required. the download kind.-->
<key>kind</key>
<string>software</string>
<!-- optional. displayed during download; typically company name -->
<key>subtitle</key>
<string>Apple</string>
<!-- required. the title to display during the download.-->
<key>title</key>
<string>Example Corporate App</string>
</dict>
</dict>
</array>
</dict>
</plist>
| 苹果官方相关文档 以无线方式安装企业内部应用 |