In this article, I will be showing how to distribute Native iOS project containing Flutter modules using Codemagic CI/CD.

The two main steps for distribution are:

  1. Code signing
  2. Publishing to App Store Connect

This is a follow-up article to “How to add Flutter modules to native iOS project and test it on Codemagic”.

Code signing

In order to publish your app to Apple App Store, you need to have a code-signed .ipa file. Before starting with the actual code signing process, you will need to have the following things:

  1. Certificate Signing Request (CSR)
  2. iOS Distribution Certificate
  3. App ID
  4. Provisioning Profile

Generating the Certificate Signing Request (CSR)

You will need a Mac to generate the CSR. The generated CSR will be stored on the local machine and contains some information related to the developer identity, which is later used by Apple for confirming the identity while generating the certificate.

  1. Open Keychain Access using Spotlight Search on Mac.
  2. From the top menu bar go to Keychain Access > Certificate Assistant > Request a Certificate From a Certificate Authority.

  1. Fill out the Certificate Information form. Leave the CA Email Address field empty. Select the option Saved to disk. Then, click on Continue.

  1. Now, you can click on Show in Finder to go to the folder where the CSR file has been created.

  1. Click on Done.

iOS Distribution Certificate

You will need an Apple Developer Membership in order to generate a certificate from the Apple Developer Portal. Various types of certificates can be generated from the portal, but to publish our app to Apple App Store we will be needing an iOS Distribution Certificate.

Follow the steps below to generate the distribution certificate:

  1. Go to the Apple Developer Portal and sign in using your Apple ID and password.
  2. Select the Certificates, IDs & Profiles option from the left menu on the Dashboard.
  3. Under the Certificates option, click on the “+” button.
  4. Select the iOS Distribution option and click on Continue.
  5. Click on Choose File to upload the CSR file that we had generated previously. Click Continue.
  6. Now, you can Download the generated iOS Distribution Certificate to your local machine.
  7. Double-click on the downloaded certificate to add it to your local device’s Keychain.
  8. You can export any certificate from your Keychain by right-clicking and selecting Export.
  9. You will have to supply a Certificate Password for securing the certificate.

#ios

iOS Code Signing and Publishing with codemagic.yaml file
4.25 GEEK