Create an iOS Distribution Certificate (P12)
1. Sign in to your Apple Developer Account on the Apple Developer website.
2. Go to the 'Certificates, Identifiers & Profiles' section.
3. Under the 'Certificates' section, select 'All' or 'Production' and click the '+' button to add a new certificate.
4. Choose 'Apple Distribution' from the Software section as the certificate type and click 'Continue'.
5. Click the 'Choose File' button and select your CSR file and click 'Continue' and follow the prompts to complete the certificate request process.
6. Download the generated distribution certificate file (with a .cer extension) from the Apple Developer website by clicking 'Download'.
7. To create the Distribution Certificate, please locate the downloaded distribution certificate file (.cer) on your Mac. Double-click the .cer file to launch the Keychain Access application.
8. Keychain Access will open and import the certificate. It should appear in the 'Certificates' category of Keychain Access, under 'login' or 'System' keychains.
9. Expand the Certificate Details: In the certificate details window, click on the triangle icon next to 'Trust' to expand the certificate details.
10. You should see a lot of pull-down menus. Please select 'Always Trust' in the section 'When using this certificate'. Close the window by clicking the red dot. You will need to enter your Mac password to finalise this step.
11. Select the login section in the left menu, right-clicking on your certificate in the list and choose 'Export Apple Distribution...'
12. Choose Export Location and File Format: In the 'Save' dialogue that appears, choose the location on your Mac where you want to save the exported .p12 file. Provide a name for the file, and from the "File Format" dropdown menu, select 'Personal Information Exchange (.p12)'.
13. Set a Password for the exported .p12 file. This password will be required when using the certificate in the future. Make sure to choose a strong and memorable password. Confirm the password in the respective field.
14. Save the .p12 File: Click the 'Save' button to export the certificate and private key as a .p12 file to the specified location on your Mac.
At this point, you have successfully created an iOS distribution certificate using a certificate signing request on your Mac. This certificate can now be used for signing your iOS app for distribution on the App Store and for AdHoc builds relevant to Purple test apps.
Keep the .p12 file in a secure location and ensure you remember the password you set during the export process.