Xcode打包IOS应用上架最新流程
针对应用测试提交,平时开发中参考了网上很多的教程,但同样也发现很多教程版本过早,无法及时针对解决问题。特此针对应用发布的一些流程进行总结,希望能够帮助大家,同样也算自己的备忘录。
一、证书的导出
1.1 前期工作
首先你需要有一个苹果的开发者帐号,一个Mac系统。
如果没有帐号可以在打开http://developer.apple.com/申请加入苹果的开发者计划。怎么申请网上有详细的介绍,因为我没有实际申请过,所以在此不多做介绍。
如果你已经有了一个IDP,打开https://developer.apple.com/并登录到苹果MemberCenter,登录以后可以看到下面这个界面,列出了你开发需要的一些工具,支持,itunes app管理等内容。见下:
![](https://img.haomeiwen.com/i5443336/0e7c6d6d1b1c00da.png)
![](http://upload-images.jianshu.io/upload_images/5443336-4a051e23c338390c.png)
1.2申请App Id
![](http://upload-images.jianshu.io/upload_images/5443336-f165705a92707e5e.png)
![](http://upload-images.jianshu.io/upload_images/5443336-aede9a2e3d68258b.png)
第一个Name,用来描述AppId,这个随便填,没有什么限制,最好是项目名称,这样方便自己辨识(不允许中文);
第二项Bundle ID (App ID Suffix),这是appid的后缀,这个需要仔细。因为这个内容和程序直接相关,后面很多地方要用到,最好是com.yourcompany.yourappname的格式,一般都会使用项目中的Bundle ID(这样比较保险),还有一个WildCard App ID使用一个通配com.yourcompany.*,可以适配多应用
![](http://upload-images.jianshu.io/upload_images/5443336-213072711e065c9e.png)
默认会选择2项,不能修改,只需要选择上自己需要的服务即可,看到网上有说是必须要选上推送,否则后面就没有办法修改了,但我们因为当前没有用到推送,没选。且亲自测试,可以修改。
然后点击Continue确认没有错的话直接点击Submit后点击Done即完成App Id的创建
1.3创建证书
1.3.1 创建一个证书请求文件
这儿需要一个Mac系统。以下内容以下图系统为例,版本差别不大。
![](http://upload-images.jianshu.io/upload_images/5443336-7aa174ba83844093.png)
首先打开应用程序-实用工具-钥匙串访问(KEY CHAIN),在证书助理中,选择"从证书颁发机构求证书",如下图:
![](http://upload-images.jianshu.io/upload_images/5443336-4ff443230328c074.png)
![](http://upload-images.jianshu.io/upload_images/5443336-b7167f9ea6ab6b96.png)
![](http://upload-images.jianshu.io/upload_images/5443336-c22fbbd4fdbc76a4.png)
选择保存的位置。点击完成,你就可以看到你的桌面多了一个CertificateSigningRequest.certSigningRequest的证书请求文件。注:CSR文件尽量每个证书都制作一次,将常用名称区分开来,因为该常用名称是证书中的密钥的名字。
1.3.2 制作Provisioning Profile证书文件
1.3.2.1 开发者证书的制作:登陆到开发者中心,找到证书配置的版块,选择
,点击右上角的加号:
![](http://upload-images.jianshu.io/upload_images/5443336-b98eecd42d972ed1.png)
![](http://upload-images.jianshu.io/upload_images/5443336-f3e5cf73e0cbcbdd.png)
![](http://upload-images.jianshu.io/upload_images/5443336-9004b9c9f2f2bd1b.png)
提交上去后就会生成一个cer证书,如图所示,有效期为一年。
![](http://upload-images.jianshu.io/upload_images/5443336-d00b6269ea5a6126.png)
1.3.2.2 Provisioning Profile证书制作:到这一步证书还没凑全,想提交AppStore还需要PP证书。
![](http://upload-images.jianshu.io/upload_images/5443336-1b7d40d97e43767f.png)
![](http://upload-images.jianshu.io/upload_images/5443336-66c9f64a91ebf9c3.png)
![](http://upload-images.jianshu.io/upload_images/5443336-b9b409e4bb3b41da.png)
注意:wildCard格式的证书没有推送,PassCard等服务的应用,慎重选择。 继续,这里有一个区别,因为PP证书的开发者证书需要真机调试,所以我们需要绑定真机,这里因为之前我添加过一些设备,所以这里就可以直 接全选添加,如果没有的话,需要将真机的udid复制出来在此添加,在发布PP文件中,是没有这一步的。
![](http://upload-images.jianshu.io/upload_images/5443336-2570d8858a1ded5f.png)
1.4 配置项目环境
1.4.1 Account配置
Xcode - - >Preferences,如图
![](http://upload-images.jianshu.io/upload_images/5443336-e546c198bfdac95b.png)
1.4.2 项目的配置
在项目Targets下的Identity中,Team选择对应的Apple ID 即可
在XCode的项目设置里,Provisioning Profile就可以选择对应的证书。
![](http://upload-images.jianshu.io/upload_images/5443336-d36c3c4ac6f28258.png)
准备工作基本完成。
二、ipa打包
2.1 Archive在线打包
1、Xcode->Product->Scheme->Edit Scheme
如下图配置
![](http://upload-images.jianshu.io/upload_images/5443336-07d07e71cdadf266.png)
2、在真机状态下选择Product->Archive(如果不是真机状态下,Archive会是灰色不可用的),成功会弹出如下图:
![](http://upload-images.jianshu.io/upload_images/5443336-aaa52c837ab26df4.png)
三、ipa提交AppStore
3.1 在itunes中创建程序
登陆开发者中心,选择ItunesConnect,进入后选择我的App
![](http://upload-images.jianshu.io/upload_images/5443336-1328e16af5030092.png)
![](http://upload-images.jianshu.io/upload_images/5443336-96f9298b9c14a58a.png)
![](http://upload-images.jianshu.io/upload_images/5443336-aefb51ad63ce5714.png)
![](http://upload-images.jianshu.io/upload_images/5443336-adde92735615c7dd.png)
注意点:
1、AppIcon:尺寸必须1024*1024
2、截图启用不同版本模拟器,按cmd+s,即可截取手机屏幕
3、4.7英寸 ->Iphone6 5.5英寸 ->Iphone6s Plus 4英寸 ->Iphone5S 3.5英寸 ->Iphone4
3.2 Ipa包上传
两种方式:
1、一种在Archive包时,右上角有个Upload to App Store 按钮,点击上传
![](http://upload-images.jianshu.io/upload_images/5443336-e5af1697965aebe9.png)
2、Application loader 打包
![](http://upload-images.jianshu.io/upload_images/5443336-b2b1378eacd45296.png)
![](http://upload-images.jianshu.io/upload_images/5443336-92fa62f107527ff5.png)
![](http://upload-images.jianshu.io/upload_images/5443336-897ee964ce3c2437.png)
![](http://upload-images.jianshu.io/upload_images/5443336-657613d53d16af64.png)
特别注意:1、这里的版本按钮,上传完后要等一段时间再刷新,大概半个小时,这里会出现+号,选择相应版本
2、测试账号一定要填上
3、中国区手机号码填写格式 +86 xxxxxxxxxxx 如:+86 18868877077
![](http://upload-images.jianshu.io/upload_images/5443336-46bfce8f36a2554e.png)
至此,大功告成,等待审核,当前的速度2天就会审核,速度很快。
当应用审核成功后,如若需要扫二维码跳转,则使用http://itunes.apple.com/app/id+AppId 制作成二维码,微信扫描后就会跳到AppStore中指自己应用页面。例:http://itunes.apple.com/app/id123456789