Generating a .p12 file
Open Keychain Access. Under the Keychain Access tab on the left top corner, select Certificate Assistant and select the option “request a certificate from a certificate authority” and fill in the following:
- User email address
- Common Name
- CA email address (not necessary).
Select saved to disk option and continue. This will generate a CSR certificate.
Visit https://developer.apple.com and login to Account with your credentials.
Click on to the tab named as Certificates, Identifiers & Profiles. The screen shown below will appear:
Click on the Production tab under All types on the right corner. Once done, click on the '+' option beside main Certificates heading and select Apple Distribution option and click continue.
choose file option upload the CER file you downloaded in step 1.a and click on Continue. Then click on Download. This will generate a .cer file.
Click on All Certificates. Under All Types, click on to Production. Download all the certificates under the Production which is iOS Distribution (Type).
Double click on all the downloaded certificates in the folder you chose for the above step.
Go back to the Keychain access and click on Certificates tab on the left. Then right click on the distribution certificate with a drop down option and select the Export option. It is important to remember the Expiry Date for later steps. Ensure that the file format is .p12 and click on Save. A pop-up will open where in you can type a password of your choice.
CONGRATULATIONS ! You have a .p12 file ready.
CREATING A PROVISION FILE(.mobileprovision)
To create a distribution provision profile for app store, visit https://developer.apple.com/account/ios/certificate
Here on the left side panel you will find Identifiers. Click on App IDs. Now click the ‘+’ button beside the Identifiers Heading. Click on AppIDs to register an App ID and click Continue.
Choose iOS, tvOS, watchOS in Platform. Add your app name in Description and Bundle ID in the following format under Explicit App ID: “com.domainname.appname” ( For example com.plugxrinc.testapp ) Now click on Continue and then Register.
Go back to the home page and click on Profiles on the left panel. Select iOS in the All Platforms option on the right top. Click on the '+' button beside the Profiles Heading.
Under Distribution, you have options to create for Ad Hoc (create a distribution provisioning profile to install your app on a limited number of registered devices)
For Ad Hoc (optional)
- Select Ad Hoc option and click Continue.
- Select the App Id created in previous steps (com.domainname.appname) and press Continue
- Select the certificate with date (as mentioned in step Keychain access, certicates tab) and press Continue
- Select all the registered devices and click Continue. (not included in App Store process)
- Provide a provisioning profile name and press Generate and then Download.
Congratulations! You have the .mobileprovision file for Ad Hoc