您的位置:首页 > 移动开发 > IOS开发

iOS开发企业版ipa分发(in-house)

2016-03-16 17:53 645 查看
http://www.360doc.com/content/16/0316/17/13256267_542735874.shtml

前言

本人公司开发的
.ipa
发布于 AppStore 和自己的服务器上。但是自己却一直没时间利用公司的资源进行研究。现在赶紧趁热打铁,记录一下,以便以后查阅。
在此之前,在网上查阅了相关资料并整理了一下加以完善更正。

背景

网上说
Xcode 6
之后版本导出企业
.ipa
包需要手动添加
.plist
文件,本人今天亲自测试了一遍,发现
Xcode 7
之后又可以配置生成的。在这里我按照我的流程走一遍。

IPA打包

在工程中选择
Product
-
Archive
进入打包界面
选择
Export
进入打包方式选择界面

选择
Save for Enterprise Deployment
选项,Next





选择对应的企业账号,然后继续即可





接下来是对安装设备的要求选择,默认选择所有设备。第二个选项是指定特定类型设备方可安装。我们使用默认第一项,Next





之后的界面是对应用的二次确认,确保APP配置准确无误。在窗口的左下方有一个
Include manifest for over-the-air installation
。该选项表示是否在生成
.ipa
文件的同时生成
.plist
文件,我们勾选上,Next





over-the-air
: OTA 是苹果在
iOS4
中新增的一项功能,目的是让企业用户能够在脱离
Apple App Store
的情况下通过网页无线发布 iOS 应用;简单来讲就是在
Safari
中点击一个链接就可以在iPhone或iPad上下载并安装应用(目前很多越狱软件都是使用的这种发布方式)。

接下来配置
.plist
文件,填写完之后,Export导出
.ipa
包和相应的
.plist
文件(建议将生成的
.plist
文件命名同APP名一致,方面后期管理)





构建网站

必备条件

需要购买一个苹果的企业版证书,价格$299/年。指南

网站需要支持HTTPS协议,用于访问下载
.plist
文件

这里有两种办法:

一种是购买SSL证书或者免费申请SSL证书
另一种是将
.plist
文件托管在第三方上面,利用第三方支持的HTTPS进行访问下载;

使用OSChina的代码托管。访问OSChina,添加一个项目;然后用git或svn客户端将
.plist
文件提交到版本库中;最后在浏览器中访问项目中的
.plist
文件,查看原始数据,即可获得plist的https下载地址。

步骤

.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 应用清单文件
12
3
4
5
6
7
8
9
10
1112
13
14
15
16
17
18
19
20
2122
23
24
25
26
27
28
29
30
3132
33
34
35
36
37
38
39
40
4142
43
44
45
46
47
48
49
50
5152
53
54
55
56
57
58
59
60
6162
63
64
65
66
67
68
69
70
7172

<!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>

苹果官方相关文档

以无线方式安装企业内部应用
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: