写在之前:
预先准备一个项目,设置好启动图片和应用程序图标。本例准备了一个名为Test888的空项目。
一、在电脑上创建一个证书请求文件(签名证书)
首先,我们需要一个Mac操作系统。
然后在 OS X EI Capitan 10.11.4 操作系统上做演示。
首先,打开
应用程序
->实用工具
->钥匙串访问(KEY CHAIN)
,如下图所示:

当然,也可以
Launchpad
->其他
->钥匙串访问

在证书助理中,选
从证书颁发机构请求证书
:

点击
从证书颁发机构申请证书
,进入如下界面:

注意:
1> 电子邮件地址: 填写你申请开发者账号的电子邮件地址
2> 常用名称: 默认就好
3> CA电子邮件地址: 空
4> 请求存储到磁盘(到时可以选择保存到桌面,方便找到使用)
点击继续,来到以下界面

点击存储,将请求文件保存到了桌面上

此时,在桌面上就可以看到一个
CertificateSigningRequest.certSigningRequest
的证书请求文件(CSR文件)。
注意: CSR文件尽量每个证书都制作一次,将常用名称区分开来,因为该常用名称是证书中的密钥的名字。
双击CSR文件,安装
签名证书

点击继续,选择
为您自己创建证书

再点击继续

点击创建,制作
自签名根证书

点击继续,证书成功创建

签名算法: 带 RSA加密的 SHA-256
公共密钥信息: RSA 加密,公共密钥256字节
二. 制作发布证书
2.1 前期准备工作
首先,需要具备以下条件
1> 苹果的开发者账号
2> Mac操作系统
3> Xcode(这里使用的是Xcode7.3正式版)
如果没有账号,可以打开 http://developer.apple.com/ 注册苹果的开发者帐号。开发者帐号具体申请流程,这里不再细述。
如果已经有开发者账号,打开http://developer.apple.com/

点击
Account
,进入到苹果 MemberCenter 的登录界面,如下:

输入自己的开发者账号,登录,进入如下界面:

2.2 发布证书的制作
点击
Certificates,Identifiers&Profiles
,进入如下界面:

点击右上角的加号按钮,然后选择
Production -> App Store and Hoc

点击
Continue

由于CSR文件已经创建好,直接点击
Continue
,然后上传 CSR 文件

点击
Choose File
,选中在Mac上配置的请求文件

点击
Continue
,这个时候,发布证书已经制作完毕

点击
Download
,这时就有了一个 .cer 证书文件`ios_distribution-8.cer

`
双击安装证书(如果安装不上,可以直接将证书文件拖拽到钥匙串访问的列表中)

三、制作Provisioning Profiles证书(简称PP证书)
到目前为止,上架所需要的证书还不齐全,想提交AppStore,还需要PP证书。
1> PP证书分为 开发用的PP证书 和 发布用的PP证书,这里我们制作的是 发布用的PP证书
2> 制作 PP 证书,需要 App ID 和 发布证书(发布证书在上一步已经做好了)
3.1 申请 App ID
选择 App IDs

然后点右上角的加号,创建一个新的 App ID

注意: 这里有两项需要我们自己填:
1> 第一项 'Name',用来描述你的 'AppID',这个随便填,没有什么限制,最好是项目名称,这样方便自己辨识(不允许包含中文);
2> 第二项 'Bundle ID (App ID Suffix)',这是你 'App ID'的后缀,这个需要仔细填写。因为这个内容和你的程序直接相关,后面很多地方都要用到,最好是'com.yourcompany.yourappname'的格式,说白了,就是用项目中的Bundle ID(这样是最保险的)。
选择你的app中需要的服务

注意:
1> wildCard格式的证书没有推送,PassCard等服务的应用,慎重选择。
2> 有一个区别,因为PP证书的开发者证书需要真机调试,所以我们需要绑定真机,如果没有的话,需要将真机的udid复制出来在此添加,在发布PP证书中,是没有这一步的。
点击
Continue
,进入如下界面

确认 App ID信息,如果无误,点击
Register

点击
Done
,这时 App ID就申请成功了

3.2 制作发布用的PP证书
点击 Provisioning Profiles,然后点击右上角的加号

点击
Continue
,如图,选择我们自己的 App ID

点击
Continue
,选择发布证书

点击
Continue
,如图,给PP证书起个名字

点击
Continue
,如图,PP证书制作完毕

点击
Download
将PP证书下载下来,如图

双击PP证书,将其添加到Xcode中
四、配置项目环境
4.1 Account的配置
Xcode ->
Preferences
->Account
,如图

1> 点击+可以选择Add Apple ID;
2> 点击View Details可以查看该Apple Id下的Certificates和Provisioning Profile证书文件,在这里你可以点击下载。

4.2 项目配置
在项目Targets下的Identity中,Team选择对应的Apple ID 即可

在Xcode的项目设置里,Provisioning Profile就可以选择对应的证书。

到此为止,前期的准备工作就做完了。
五、ipa打包
5.1 Archive在线打包
在真机状态下选择
Product
->Archive
(如果不是真机状态下,Archive会是灰色不可用的),成功会弹出如下图:


1> Validate表示验证,Export表示导出
2> 建议先点击Validate进行验证,验证的过程有点慢,但是为了审核顺利点,还是验证下为好。
3> 验证成功后点击Export导出ipa的包用与上传即可。


六、ipa提交App Store
6.1 在 iTunes中创建程序
选择 iTunes Connect


进入 iTunes Connect 网页

打开我的App,然后点击左上角的加号,新建 App

弹出以下界面,设置 App信息

1> 名称:指的是App上架后,显示在App Store中的名称
2> 主要语言: Simplified Chinese(简体中文)
3> 套装ID: Test888-com.iOS.www.*
就是之前申请的 App ID
4> 套装ID后缀: Test888
后缀就是Xcode中的 Bundle Identifier 最后一个点后面的内容(本例中是 Test888)
5> SKU: 可以使用项目中的 Bundle Identifier
点击
创建

价格与销售范围
,根据app不同自己填写

设置完App信息,点击
准备提交
,进入如下界面

设置
App预览和屏幕快照

注意:
1> 这里需要不同屏幕的截图,可以直接用模拟器运行后截图。待模拟器运行开始的时候,按住cmd+S, 模拟器的屏幕截图就直接保存在桌面上了
2> 每种尺寸的屏幕截图必须是在模拟器100%的比例下进行截取。否则会报错。
3> 上传的时候会提示“无法载入文件”的问题。原因是:截图保存的文件名有中文,修改下截图名称即可!
4> 屏幕尺寸大家都可以查到,为了自己方便,简单备注下:
4.7英寸 -> iPhone6/s 5.5英寸—>iPhone 6/s Plus 4英寸 —>iPhone5S 3.5英寸 —> iPhone 4S
设置
App描述
和关键字

1> 描述: 对App进行简要介绍,让用户快速了解App的基本功能
2> 关键字: 用户可以通过这些关键字找到App
3> 技术支持网址
4> 营销网址
设置
App 综合信息

注意:
1> 上传App Icon的时候,需要上传1024*1024的,而且不能有圆角效果和透明效果!
2> 点击编辑,设置分级,需要根据app的实际情况来设置
3> 版权,app的所有者和获利时间
App 审核信息

注意: 审核信息,必须填写
设置
版本
发布选项,本例选择的是手动发布

提交构建版本,打开Xcode,上传应用程序包


等上几分钟

有两种方式:
1> Xcode 6或更高版本
2> Application Loader 3.0或更高版本提交构建版本
回到 iTunes Connect网页,选择构建版本

点击
提交以供审核

1> 出口合规信息: 如果使用了加密,选择『是』,否则选『否』
2> 内容版权: 包含了第三方的东西,就选『是』,否则选『否』
3> 广告标识符(IDFA): 这个一定要选对,选错了会导致二进制文件永久被拒,需要重新提交二进制文件。
点击
提交

到此,整个 App 上架流程就演示完了!