iOS 开发之账号及证书制作

做为一名
iOSer
,上面的画面你肯定不陌生!选择总是很难,但当你了解了iOS
开发中的账号及各种证书,以上选择就是 a peciece of cake
!
iOS开发都有哪几种账号?
答:4 种 !
分别是:
个人开发都账号($99/年)
公司开发者账号($99/年)
企业开发者账号($299/年)
教育账号(free)
个人开发者账号
以个人开发者的身份申请;
价格:$99/年
特点:此账号生成的证书 可以 上 App Store
以 pin
为例,是个人开发者发布到 App Store
上面的。你可以看到个人开发者的一些信息

公司开发者账号
以 公司/企业
名义申请,需要提供 公司/企业
的邓白氏(DUNS)码
价格:$99/年
此账号生成的证书 可以 上 App Store
以 微信 为例,这个是腾讯公司的产品,是属于典型的 公司/企业
开发者。

企业开发者账号
只能以 公司/企业
名义申请,需要提供 公司/企业
的邓白氏(DUNS)码
价格:$299/年
此账号生成的证书 不可以 上 AppStore,只能在公司/企业
内部进行分发。
教育账号
这类主要是面向教育机构的账号,使用此类账号打包生成的 ipa 是不能够上 App Store 的,且审核严格。所以一般我们也用不到。
以上分法比较细,也可以能否上 App Store进行区分。
如果按能否上 App Store 其实分成两种也是可以的。但以个人名义申请与以公司/企业名义申请的 $99/年 的证书还是有区别的。
以个人名义申请的账号不可以挂靠多个开发者,以公司/企业名义申请的则可以挂靠多个开发者。
不管你是按价格区分,还是按能不能上 App Store
区分,只要能清楚的知道在什么情况下使用哪种账号创建证书,就够了!
证书制作
证书类型
- 开发(
Development
)证书; - 发布(
Release
)证书; - 推送证书;
-
VoIP
证书;
下面我们来看一看证书的制作过程 。
由于 开发(Development)证书
与 发布(Release)证书
的制作过程是一样的,这里就以制作开发(Development)证书打个样。
制作开发(Development)证书
第一步:首先在本地生成一个后缀名为CSR
文件,后缀名为.certSigningRequest
。
打开钥匙串,在菜单中做如下选择 Keychain Access -> Certificate Assistant -> Reqeust a Certificate From a Certificate Authority...

在弹出 CSR 文件的创建界面,填写
Email Address
(邮箱地址是必填项),下面选项一般选择Saved to disk(保存到磁盘)
。然后点击 Continue,接下来保存就可以了。这里生成的 CSR
文件后面将会用到。

第二步:登录你的开发者账号,真正开始进行证书的制作。
登录开发者账号成功之后,来到下面的界面

选择 Certificates, Identifiers & Profiles,进入到证书管理页面。默认会选择 Certificate

点击上方 Certificates 后面的 加号,制作证书

选择 iOS App Development,可以看到右上角的 Continue 按钮可点。点击 Continue

点击 Choose File,选择我们第一步中生成的 CSR 文件上传,然后点击右上角 Continue,这里就生成了一个证书。点击 Download,可以看到是一个后缀名为 .cer
的证书。

第三步:注册 AppID (Bundle Identifier)
选中左边栏的 Identifiers,然后点击上方 Identifiers 右边的 加号,创建 AppID

选中 App IDs,点击右上方 Continue

接下来填写 App ID 相关的信息

填写完成之后,点击右上方 Continue

确认一下,无误的话点击 Register 即可完成 App ID 的创建,在返回到开始的 Identifiers 页面是,可以查看你创建的 App ID。
第四步:创建 Profile 文件
选中 Profiles,点击上方 Profiles 右边的加号,进行 Profile 文件的创建

选中 iOS App Development,点击右上方 Continue

选择之前生成的 App ID,点击右上方 Continue

选择第二步生成的后缀名为.cer
的证书

选择注册设备

填写 Profile 文件的 name,然后选择右上方的 Generate

这样,一个开发调试用的 Profile 证书就生成了。下载之后,可以得到一个后缀名为
mobileprovision
的文件。
制作 发布(Release)证书的过程与 开发(Development)证书的过程中一样的,照葫芦画瓢就行。
制作推送证书
点击你创建的 App ID,会来到 App ID 的详情页

点击 Configure

有两个选项,以制作开发调试推送证书为例,点击第一个 Create Certificate

选择 平台,然后上传 CSR 文件,之后点击 Continue

一个开发调试的推送证书制作完毕。 Release 推送证书流程也是这样的。
依然比葫芦画瓢即可!
制作 VoIP 证书
从 Certificates 入口进,拖动页面至下方,可以看到 VoIP Services Certificate 选项

选择 App ID

选择 CSR 文件

VoIP 证书制作完毕,接下来就可以下载使用了。

说明,VoIP 证书只有一份,没有 Development
和 Release
之分。
通常情况下,一个工程可能有多个开发者,这时候就需要把证书分发给其他小伙伴进行使用。这里,就需要导出一个 p12
文件。
导出 p12
打开钥匙串,选择要导出p12
的证书,右键单击调出菜单,选择 Export "xxx"

重新命名 p12
名称,以便区分。而后点击 Save

输入 p12
文件安装密码

p12
文件导出成功!
其它证书的 p12
文件导出过程是一样的,一一导出保存即可。
全部完成之后,就可能把证书发送给开发小伙伴进行愉快的调试了!
至此,常用的证书已经制作完毕。分别下载双击就可以进行真机调试、发布 App Store 了。
回到最初的那个问题上面来,来看看他们究竟都表示什么意思。
- App Store Connect
发布到 App Store,这里对应的是Release
证书; - Ad Hoc
针对注册设备,对应的是Release
证书,但打出来的包不能发布到 App Store; - Enterprise
对应企业账号创建的证书,打出来的包可以安装到任何设备; - Development
对应Development
证书,打出的包只有注册设备才能安装,一般真机测试时用;
以上内容,如有错误,欢迎指正!
引用
-
https://help.apple.com/developer-account/?lang=zh-cn#/dev7a05c5ce1
英文版
https://help.apple.com/developer-account/?lang=en#/dev7a05c5ce1 - https://developer.apple.com/support/compare-memberships
- https://developer.apple.com/programs/
- https://developer.apple.com/programs/enterprise/
- https://developer.apple.com/programs/ios/university/