How do I Create a Distribution Profile for iOS?
This lesson describes how to set up a distribution profile that can be used for applications built with LiveCode. It is assumed that you have signed up to the iOS Apple Developer Program. Screen captures are provided.
A distribution profile is required if want to release your iOS application through the online Apple store.
The information discussed here is reduced and is also covered on the apple iOS Provisioning Portal website. You can access that additional information by logging into the iOS provisioning portal that is accessible from: https://developer.apple.com/. Select the Member Center and use your login credentials to log into your account. Depending if you are a developer for Mac apps and/or iOS apps your login screen may differ. You may have to follow a link to the iOS Dev Center. Then follow the link to the iOS Provisioning Portal. The iOS Provisioning Portal provides you with a link to Distribution. Select the Prepare App tab and select the highlighted headings in order to expand the steps provided by Apple.
Generating a Certificate Signing Request
The first step in setting up a distribution profile is to create a certificate signing request. You can do this on your Mac. Launch the Keychain Access.app that is stored in Applications/Utilities. Then execute the following steps in your Keychain Access application:
1. Select Keychain Access > Certificate Assistant > Request a Certificate From a Certificate Authority... and ensure that you do not have any of your certificates highlighted, otherwise the Provisioning Portal will not accept your certificate request.
2. Enter your valid e-mail address in the User Email Address field. Ensure that the e-mail address is the same as the one you used when you registered as an iOS Developer.
3. Enter your name in the Common Name field. Ensure that the name you enter is the same as the one you used when you registered as an iOS Developer.
4. A CA Email Address is not required.
5. Select the Save to disk radio button and tick Let me specify key pair information, if it is present.
6. Press Continue.
7. A dialog appears that allows you to specify where you would like the certificate signing request to be stored. Specify a location and select Save.
8. Press Continue.
9. The certificate is then generated and written to the file you specified under step 8.
In older versions of Keychain Access step 1 was
Select Preferences > Certificates and ensure that Online Certificates Status Protocol (OSCP) and Certificate Revocation List (CRL) are set to Off.
Submitting a Certificate Signing Request
After you have generated a certificate signing request, you need to submit your certificate for approval. Log into the iOS Provisioning Portal that is accessible from: https://developer.apple.com/account/ios/certificate/certificateList.action.
This link takes you directly to the Certificates, Identifiers & Profiles section of your iOs developer account. Select the "Production" tab and follow these steps:
1. Select the Add Certificate button.
2. Select "App Store and Ad Hoc" as type then press continue
3. On next screen press "Continue"
4. On next screen select "Choose File" and select the certificate you created in previous step and then press "Generate"
Downloading and Installing a Distribution Certificate
Remain on the same page as the one you were on when you submitted the certificate signing request, then follow these steps to download and install the certificate:
5. Download Generated certificate by clicking the "Download" button.
6. Double click the downloaded certificate to install (alternatively drag to the keychain utility)
Backing up your Certificates
It is important that you backup the keys you created. This allows you to develop on multiple Macs or reinstall the keys after unexpected data loss. You can export your private keys and certificates through the Keychain Access application:
1. Open the application Keychain Access.app that is stored in Applications/Utilities.
2. Select Keys.
3. Highlight the private key associated with the distribution certificate.
4. Select File > Export Items.
5. A window opens that allows you to specify where you would like to save your certificate.
6. Select Personal Information Exchange (.p12) as file format.
7. Select the file name.
8. Select Save.
9. You are prompted for passwords that allow you to access the key in the future
Downloading the Distribution Profile
This is the final stage and will create the distribution provisioning profile you need to use when building your iOS standalone. Start by selecting the "Distribution" tab from "Provisioning Profiles"-
1. Select New Profile (+)
2. Select App Store as the Distribution Method.
3. Enter the Profile name.
4. Ensure that your Distribution Certificate has been created and is displayed correctly.
5. Select the appropriate App ID for your applicatoin
6. Select Generate.
7. Select the Download button from next to the Distribution Provisioning Profile you created.
This allows you to download the .mobileprovision file.
8. Double click the .mobileprovision install the Distribution Provisioning Profile on your computer.
You are now ready to move on to lesson: How do I set up an App for Submission to iTunes Connect?
Video Lesson Showing the above
We have recently create a tutorial video showing a step-by-step guide of the above
I'm nto sure why this post isn't being commented on by more people. It's Fantastic! This is the only place I've found step by step instructions so clearly laid out.
Thank for the great post!
If I have the certificates downloaded and then want to create the key how do you link the two things together? or do I have to revoke it and start fresh. I did not create the original certificate, my developer did.
if your developer created the certificate, then he should also have the keys. You could ask him for the keys. Step: "Backing up your Certificates" provides the information you need for backing the keys up.
I've got the distribution certificate but there are no keys associated with it. Without those keys the Organizer is complaining about linkage. What to do?
your keys are generated using the Keychain Access Utility on your Mac. If you have a distribution certificate then the keys to generate it would have been created too. The iOS Developers portal provides more details and up to date information on this topic than is captured in this lesson.
So this explains how to set up distribution through iTunes. Is there a way to distribute apps made with LiveCode to iOS users without using iTunes? For example, if a client wants an app to be used only internally by their team, and not be available to the public. Is this possible?
Thanks in advance!
yes, it is possible. Your client can register as an iOS developer and create a team provisioning profile that has a number of devices associated with it. Instructions on how to do so are provided in the iOS Provisioning Portal. The lesson "How do I Become an iOS developer": http://lessons.runrev.com/s/lessons/m/4069/l/23275 should be a starting point, but you will have to delve into the documentation from Apple.
very clear instructions for this process, which is not the case on the myriad of sites claiming to cover this topic ! Thank you.
Very nice tutorial. Thanks
very neat and clear explanation
This post is great.
But I want to install existing certificates on a new mac system where no certificates have been installed before.
Can you please let me know steps for it?
Hi Vaibhav, you can export your Developer account, including certificates from one Mac to another. This article explains how
I hope that helps.
1. Select Preferences > Certificates and ensure that Online Certificates Status
Protocol (OSCP) and Certificate Revocation List (CRL) are set to Off.
I cannot find this step in my MACbook pro, I am on mac catalina and when I select keychain access then go to preferences, i see a checkbox for select directory services for certificates
That step is no longer required. I have updated the lesson to reflect this. Thanks for bringing this to our attention.
If I wanted to submit another different Application, I would need to just create a new Bundle ID right? Meaning to say I can use the existing stuff I created such as certificates and just create a new Bundle ID for a different app?
You will need a new Bundle ID and you will probably need new provisioning profiles that match the new ID. You can use the same Certificates.
If you created wildcard profiles you won't need new ones as long as the first part of the ID matches.
I hope that helps.