iOS开发企业版ipa分发(In-House模式)记录

来源:互联网 发布:sql force index 编辑:程序博客网 时间:2024/05/28 11:28

背景

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

IPA打包

  1. 在工程中选择Product-Archive进入打包界面
  2. 选择Export进入打包方式选择界面
  3. 选择Save for Enterprise Deployment选项,Next


    打包方式
  4. 选择对应的企业账号,然后继续即可


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


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


    确认配置

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

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


    配置plist文件

构建网站

必备条件

  • 需要购买一个苹果的企业版证书,价格$299/年。指南
  • 网站需要支持HTTPS协议,用于访问下载.plist文件

    这里有两种办法:

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

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

步骤

  1. .plist文件与.ipa文件上传至服务器供用户访问
  2. 创建一个包含如下代码的网页,用户轻点 Web 链接后会下载.plist文件,并触发下载和安装

    以下是示例链接:

     <a href="itms-services://?action=download-manifest&url=https://example.com/manifest.plist">Install App</a>
  3. 配置服务器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-image57 x 57 像素的 PNG 图像,在下载和安装过程中显示。指定图像的完全限定 URL

  • full-size-image512 x 512 像素的 PNG 图像,表示 iTunes 中相应的应用

  • bundle-identifier应用的包标识符,与 Xcode 项目中指定的完全一样

  • bundle-version应用的包版本,在 Xcode 项目中指定

  • title下载和安装过程中显示的应用的名称

样本清单文件(下面给出)还包含可选键。例如,如果应用文件太大,并且想要在执行错误检验(TCP 通信通常会执行该检验)的基础上确保下载的完整性,可以使用 MD5 键。

通过指定项目数组的附加成员,您可以使用一个清单文件安装多个应用。

示例 iOS 应用清单文件

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

苹果官方相关文档
以无线方式安装企业内部应用

0 0
原创粉丝点击