Publishing your iPhone app on the Apple AppStore is the final stage in your app making process, and allows people to download it to their own phones. But unfortunately, the process of publishing through Apple can be a bit tricky if you’ve never done it before, so, here’s a walkthrough of the process to create a p12 file – one of the crucial AppStore publishing files.
Please note: these instructions are written for Mac users, as the Apple publishing process requires you to have access to a Mac computer. If you’re publishing an app through AppFurnace, but don’t have access to a Mac computer, contact us through firstname.lastname@example.org and we’ll see if we can help you.
Creating the .p12 file
The .p12 file includes the certificates that Apple software needs to build apps, which can be uploaded to your Apple Developer account. Once you’ve created this file, you can use it to create an executable version of your app for use on your phone – but more crucially, you’ll need it to publish your app on the Apple AppStore.
- Open the Keychain Access program on your computer (found in Applications/Utilities)
- Open Keychain Access > Preferences, and open the Certificates tab
- For “Online Certificate Status Protocol” and “Certificate Revocation List”, select “Off”
- Open Keychain Access > Certificate Assistant > Request a Certificate From a Certificate Authority
Note: In the main Keychain Access window, make sure that you don’t have a private key selected, otherwise this process will not work correctly.
- Enter the email address and name that you used to register in the iOS Developer Program for the email address and common name fields.
You don’t need to enter a CA Email Address
- Select “Saved to Disk”
- Select “Let me specify key pair information”
- Click Continue
- Enter a filename and choose a destination (e.g. “certificate.certSigningRequest”)
- Click Save
- For “Key Size” choose “2048 bits”
- For “Algorithm” choose “RSA”
- Click Continue and the certificate request file will be saved to the destination you chose in step 9
- This will create a private key in Keychain Access with the Common Name you entered earlier. This will appear in Keychain Access as a key icon with your name written next to it (e.g. John Smith)
- Log on to https://developer.apple.com/ using the Team Agent account (the main user account for your iOS developer profile)
- Navigate to the “iOS Provisioning Portal” if you’re not already there
- Click “Certificates” from the left-hand panel
- Click the “Distribution” tab
- Click “Request Certificate”
- Click “Choose File” & choose the certificate request file you’ve just made from the list
- Click Submit
- Click the ‘Accept Certificate Signing Request’ button
- Your distribution certificate should now be listed under Current Distribution Certificate. If it doesn’t appear automatically, you may need to refresh the page.
- Click the “Download” button, and you’ll get a distribution.cer file. Once it’s downloaded, click it and it will open in the Keychain Access program we used earlier.
NOTE: You don’t need to upload this file to AppFurnace.
- If you see a popup saying ‘Do you want to add the certificate to a keychain?’ choose ‘login’ and hit Add
Now we need to export both the certificate file you just created, and the private key that we created earlier, to a single .p12 file that we’ll then upload to AppFurnace.
- Back in the Keychain Access program, select the login keychain from the top-left panel
- Select “Keys” from the “Category” menu in the left panel
- Find the private key associated with your iPhone Distribution Certificate. This private key is called <First Name> <Last Name> (e.g. John Smith)
- Expand this item, and inside you should see the Certificate (iPhone Distribution: <First Name> <Last Name> )
- Select BOTH the key and the certificate (Hold CMD and click both items)
- Right click and select Export 2 Items…
- Save your key in the Personal Information Exchange (.p12) file format, and call the file “Certificates.p12”
- You will be prompted to create a password that is used when you attempt to import this key on another computer
- Set the password to blank in both cases
This is the final p12 file you’ll need, so keep it in a safe place.
Next time, we’ll be covering how to create mobile provisioning files in the Developer interface.