iosflutterfirebasecicdcodemagic

Build & Distributing an iOS app with Codemagic CI / CD


I am trying to setup a complete CI / CD workflow with Codemagic on my GitLab repository for my Flutter project in order to distribute and publish the iOS and Android apps on Firebase App Distribution.

So far I successfully manage to have it work for Android, however it won't work for iOS although the job completes successfully on Codemagic.

Looking at the generated artifacts:

Generated artifacts upon successful build

To my suprise, I noticed that Codemagic generated a zip file containing an .app file. To my understanding, such is the file extension for MacOS Applications, not iOS applications which is .ipa.

I don't even have the right plan to build MacOS Apps:

targeted platforms

Before posting here, I looked at tutorials and various somewhat outdated guides because all of them showed an option, in the build settings for a checkbox titled "Flutter build ipa" that does not exist on my CI / CD.

I don't understand where I got things wrong.


Here a few screenshots of the workflow setup:

Build setup:

Build setup

Firebase Distribution setup

Thanks in advance for the help. enter image description here


Solution

  • Have you setup your iOS build with the required configuration for code signing? as having the Runner.app.zip as build artifact is the normal result of having setup your iOS build to be a debug build and debug builds are only for running on an iOS Simulator.

    For example if I setup a Codemagic project to do debug builds for iOS, ie. in the builds log you see for the build step:

    == Building for iOS ==
    
    > flutter build ios --debug --no-codesign
    
    ... [REDACTED] ...
    
    Running Xcode build...                                          
    Xcode build done.                                           35.8s
    Built /Users/builder/clone/build/ios/iphoneos/Runner.app.
    

    then as you can see in the log, the expected artifact produced on successful build is Runner.app.zip