以开发一个"MobileCAP" app为例
Step 1: Create cert request file。(当你在apple web site "provisioning portal"里生成"Development Certificate" 和 "Push SSL Certificate"时就会用到它)
1. Access "keychain access" by selecting "Application > Utilities > keychain access"
2. select menu "keychain access > certificate assistant > request certificate from a certificate authority"
3. set "User Email Address" as the same email address that you used to sign up for the iOS Developer Program, and set "Common Name" as "MobileCAP", leave "CA Email address" empty, and tick "Save to disk" option, click Continue button
4. set “Save the file” as “MobileCAP.certSigningRequest”.
当完成step 1后,就会在Keychain Access的“Keys” section里生成了name为"MobileCAP"的public key and private key pair
在Step 1过程中,有可能出error ''The specified item could not be found in the keychain"。解决方法是:restart keychain tool, and then 在keychain tool里,不要选择"keys" item,应该选择"all items",and then try again! (make sure you see "Let me specify key pair information" option in first wizard window, if you can't see it, may still fail)
参考链接 http://blog.youkuaiyun.com/totogogo/article/details/18632211
Step 2: export "MobileCAP" private key to a ".p12" file(该文件会在后面生成apns provider的.p12 or .pem file时用到)
1. right click "MobileCAP“ private key and select "Export MobileCAP..."2. Save the private key as “MobileCAPKey.p12” file, click Save button
3. 这时会让你输入2次用于加密该.p12 file的密码,例如用"123456",接着会要求你输入一次your mac account password
Step 3: Generate a "development certificate" file and download it (会生成一个cert file,该cert会被import to keychain access里,若你要在真机上调试app,这步是必须的,另外该development certificate会在后面创建provisioning profile时用到)
注意:"development certificate"是与developer account对应的,即一个developer account只能生成一个"development certificate"。如果你之前已经创建过该cert, then just download it
1. 在apple web site "provisioning portal > Certificates" page, click "request certificate" button
2. 然后选定step 1生成的cert request file "MobileCAP.certSigningRequest"
3. follow the wizard, 就会生成一个cert file "ios_development.cer" file, and then click the "download" link to download it
Step 4: 创建Registered device (这是把你要进行调试app的device添加到apple web site "provisioning portal > Devices" page,若你要在真机上调试app,这步是必须的,另外在后面创建provisioning profile时要把该device包含进去,否则无法在该device上调试)
1. 在apple web site "provisioning portal > Devices" page, click "Add Device" button
2. 输入device name (任意名字)and device id (把你的device连接到电脑后,在iTunes可以查到device id)
Step 5: Create App ID (若你要在真机上调试app,这步是必须的,另外它会在后面创建provisioning profile时用到,每个provisioning profile只对应一个app ID)
关于App ID和你创建的project的product name, company identifier的关系参看 http://blog.youkuaiyun.com/totogogo/article/details/7377870
App ID是开发和预配置系统的重要组件。这个唯一的ID允许应用程序与Apple Push Notification服务以及与外部硬件附件通信。App ID也可以用于在一组应用程序内共享密钥链数据,比如密码。另外它还用于configuration data between your applications using