用企业版证书,发布in house app

苹果企业版证书,虽然不能上app store,但是可以实现在网页上直接点击下载,而且不需要知道设备的UDID,合理使用的话还是很方便的。昨天用这种方式发布成功了,本文总结一下步骤

首先,在xcode中export的时候,可以看到有3个选项:

第一个是提交到app store;第二个是打出IPA,然后就可以通过iTunes安装;第三个就是打出企业版的IPA,可以直接通过网页安装。这种发布方式也叫做in house

以下是发布in house app的步骤

申请苹果企业版开发账号

网址是:enterprise program,一年$299

申请通过之后,还要在后台配置AppId,Certificates,Profiles等

修改xcode配置

主要需要配置2个地方,第一个是General里的team,配置成enterprise program所在的team,这步一般都不会忘记

另一个是比较容易遗漏的地方,需要在Build Settings里配置Code Signing

配置OK以后,就可以打出in house方式的IPA包了

设置下载链接

有了ipa,就可以放到网页上了,同时还需要一个plist文件,必须跟ipa同名

核心的下载链接很简单:

 

Html代码  收藏代码
  1. <href='itms-services://?action=download-manifest&url=https://www.xxx.com/ipa/ipa_name.plist'>点击安装</a>  

plist从xcode6开始不会自动生成了,需要手工编辑。内容类似:

 

Html代码  收藏代码
  1. <?xml version="1.0" encoding="UTF-8"?>  
  2. <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">  
  3. <plist version="1.0">  
  4. <dict>  
  5.     <key>items</key>  
  6.     <array>  
  7.         <dict>  
  8.             <key>assets</key>  
  9.             <array>  
  10.                 <dict>  
  11.                     <key>kind</key>  
  12.                     <string>software-package</string>  
  13.                     <key>url</key>  
  14.                     <string>http://www.xxx.com/ipa/ipa_name.ipa</string>  
  15.                 </dict>  
  16.                 <dict>  
  17.                     <key>kind</key>  
  18.                     <string>full-size-image</string>  
  19.                     <key>needs-shine</key>  
  20.                     <true/>  
  21.                     <key>url</key>  
  22.                     <string>http://www.xxx.com/ipa/icon_120.png</string>  
  23.                 </dict>  
  24.                 <dict>  
  25.                     <key>kind</key>  
  26.                     <string>display-image</string>  
  27.                     <key>needs-shine</key>  
  28.                     <true/>  
  29.                     <key>url</key>  
  30.                     <string>http://www.xxx.com/ipa/icon_120.png</string>  
  31.                 </dict>  
  32.             </array>  
  33.             <key>metadata</key>  
  34.             <dict>  
  35.                 <key>bundle-identifier</key>  
  36.                 <string>app bundle id</string>  
  37.                 <key>bundle-version</key>  
  38.                 <string>1.0.0</string>  
  39.                 <key>kind</key>  
  40.                 <string>software</string>  
  41.                 <key>title</key>  
  42.                 <string>your app name</string>  
  43.             </dict>  
  44.         </dict>  
  45.     </array>  
  46. </dict>  
  47. </plist>  

然后,这个plist必须通过https协议访问。如果是http,会有错误提示,“无法安装应用,因为XXX的证书不可用”。然后该网站的服务器证书,也不能是自签名证书,必须是CA签发的证书,否则也不能成功安装。所以还需要想办法弄一个证书,可以去买一个,也可以去申请一个免费的
posted @ 2015-10-27 14:42  GX-  阅读(376)  评论(0编辑  收藏  举报