Apple is infamous for making submitting an app to the App Store unnecessarily hard. The purpose of this tutorial is to help you get up and running with iOS development certificates along with creating and using Provisioning Profiles in Xcode.
For this tutorial, we’ll request a development and distribution certificate and then create three Provisioning Profiles: one for development, one for App Store submission and also one for ad-hoc distribution. Once we’ve done that, we’ll Archive our application using the ad-hoc profile.
Requesting and Creating Certificates
This tutorial assumes that you are a paid, registered iOS developer and have access to the iOS Provisioning Portals. It also assumes you have the sufficient permissions to request certificates and create Provisioning Profiles.
1. First, go to the Apple Developer Center and select iOS Dev Center from the main page.
2. Next, you need to sign in – click on the login button in the center of the screen or the one in the top right hand corner and you’ll be taken to a login page. Enter the email address and password you used to set up your developer account.
3. Once you’ve signed, click on iOS Provisioning Portal in the sidebar on the right. Click on Certificates from the left hand side and assuming you haven’t done this before, you should not have any certificates and need to generate one.
4. Go back to Finder and in Spotlight, search for Keychain Access (if you can’t find it, go to Application – Utilizes – Keychain Access). This is where your Mac deals with all the certificates associated with your computer.
5. With Keychain Access open, go to Keychain Access in the Finder bar and select Certificate Assistant – Request a Certificate from a Certificate Authority and the Certificate Assistant should now open.
6. With the Certificate Assistant open, enter your email address (you can use any email address, as long as it’s valid – generally, I use the email address associated with my developer account), make sure your name is correct and check Saved to disk. Also check Let me specify key pair information and then press Continue.
7. Choose to save the new file that’s going to be created to your Desktop and leave the name as it is. Press Save and make sure the Key Size is 2048 bits and the Algorithm is RSA (these are usually the default values). Press Next and the Certificate Assistant will create your new request file and save it to your Desktop.
8. With that somewhat obscure file created, go back to the iOS Provisioning Portal (the Certificates section) and then, firstly, download the WWDR intermediate certificate and open that file (it should open with Keychain Access and make sure ‘Login’ is specified when you open it) and now press Request Certificate.
9. You’ll be taken to a new page, scroll down to the bottom and press Choose File… and navigate to the Desktop. Choose the request file we created earlier and press Next.
10. Now, you’ll be taken back to the Provisioning Portal main page, click download next to your certificate and open it once it’s downloaded. If prompted choose ‘Login’.
11. Click on the Distribution tab at the top and do the same thing (you can use the same request file) and download the new certificate.
Creating the Provisioning Profiles
So far, we’ve requested and downloaded two certificates from our developer account, a development one and a distribution one – we now need to use these certificates and associate them with provisioning profiles.
1. In the left-hand sidebar in the Provisioning Portal, click on Provisioning.
2. Here is where you’ll create the new profiles. There are two kinds: development and distribution. Strictly speaking, you don’t always need a development profile to make and run an app however you need a distribution one to submit an app to the App Store. Along the top bar, select Distribution.
3. With that selected, click on New Profile in the right-hand corner.
4. Now, we need to specify what we’re going to use the profile for along with a name and the devices it will cater for.
5. First choose App Store or Ad Hoc. For this tutorial I’ll choose Ad Hoc. Give your profile a name — generally you name the profile after the app you’re making it for and the profile type, so I’ve called mine MyApp Ad Hoc.
6. Once you’ve named your profile, you need to specify an App ID. An App ID is something unique to the application you’re creating and needs to correspond with the Bundle Identifier in Xcode, select the correct one.
7. As this is an Ad Hoc profile, you want to use it so you can let people use an app that hasn’t yet been published through the App Store. To do this you’ll need to specify the devices that your app will work on. Once you’ve selected your devices, click Submit and your profile will be generated.
8. Now, click Download next to the profile that you’ve just created and open the downloaded file. It should open with Xcode.
You’ve successfully created a distribution certificate and then associated the certificate with a provisioning profile that you can now use to share your app with specified devices.