Tuesday 1 January 2013

Getting an Apple Developer Certificate


Getting an Apple Developer Certificate

1.) Create your Apple developer account and join the iOS Developer Program. It will cost you $99/year and it allows you to test your apps on a device and distribute your apps in the app store. You can go here to register.
http://developer.apple.com/programs/ios/
iOS Developer Program site

2.) Now that you are registered the first thing we need to do is generate a Certificate Signing Request. We can do this in KeyChain Access on our mac. It’s in the Utilities folder under Applications.
Keychain Access in Utilities folder
3.) After you have opened up Keychain Access go to Preferences.
Open Keychain Access Preferences
Go to the Certificates tab and make sure “Online Certificate Status Protocol (OCSP)” and “Certificate Revocation List (CRL)” are both set to Off.
Preferences Window
Close the Preferences window and choose “Keychain Access -> Certificate Assistant -> Request a Certificate from a Certificate Authority”.
Create CSR from Certificate Assistant
4.) Enter the “User Email Address” and “Common Name” that you submitted when you registered as an iOS developer. “CA Email Address” is not required.
Select “Saved to disk” and “Let me specify key pair information”.
Certifcate Assistant
Click continue.
5.) Specify a file name and a place to save the CSR. Here I’m just using the default name and saving it to the desktop.
Default name of file in Certificate Assistant
6.) Select 2048 bits for the Key Size, and RSA for the Algorithm.
Set Key Size and Algorithm
Click continue.
7.) The CSR has now been created and saved to your desktop.
CSR created
You can now close Keychain Access.
8.) Now that we have the CSR created it’s time to submit it. We do this in the iOS Provisioning Portal at http://developer.apple.com/. You won’t be able to see or access the provisioning portal until you are registered as an iOS developer and logged in.
iOS Dev Center
9.) After going to the provisioning portal select Certificates on the left side.
iOS Provisioning Portal
10.) If you don’t have the WWDR installed download it and install it. After you download it, just double click it and Keychain will install it for you. Then it should show up in the certificates category.
WWDR in Keychain Access
11.) After you have the WWDR certificate installed it’s time to request the main certificate. Click the “Request Certificate” button.
You’ll see a screen with instructions not unlike what you have ready here. How about that? Go to the bottom and click browse, then navigate to your CSR on your local machine.
Upload CSR
After selecting your file click Open, then click Submit on the next screen.
Browse for CSR in Certificates section
12.) After hitting submit your request shows up in the Signing Requests section.
Signing Requests
Because of the way our team is set up here at work I am then able to go and approve the request. This may be different with an individual account or a different team setup.
13.) After being approved, your certificate will show up under Current Development Certificates.
Your Certificate
Click the download button to download it to your mac.
After it’s downloaded double click the file to install it in Keychain Access. Actually after double clicking, Keychain does all the work and it will just show up in your certificates.
Certificate shows up in Keychain Access
14.) If you open Xcode and go to the Organizer window
Go to Organizer in Xcode
you should now see the new certificate there also.
Certificate shows up in Organizer Window
To build with the new certificate you can either select the app under Targets.
App Targets
And do Get Info on it (command i).
Or you can to Project > Edit Project Settings
Edit Project Settings
Either way will open up the project info window and from there go to the Build tab and scroll down to the Code Signing section and select the new certificate for Code Signing Identity.
Project Info Window
15.) That’s it. You now have your new certificate installed and selected, you can connect your device and click Build and Run.