How build a flutter app for each export method for iOS with fastlane

Issue

I need to deploy my app ad-hoc and to the play store, currently in my CI flow I do this for every PR with Fastlane:

sh("flutter build ios")
build_app(export_method: method)
  • Fastlane: tool to automate the build/test/deploy steps.
  • build_app: is a plugin from fastlane to build iOS, and I use it because I can declare if the build is ad-hoc or app-store.

I was worried that I’m doing 2 times the same thing, first time I build with flutter and then with native XCode.

I have two questions:

  1. Can I build the flutter iOS build for each method from a flutter command?
  2. What is the difference of build the iOS from flutter instead of running it from XCode like a total native iOS app?

Solution

The answer is to use update_code_signing_settings with profile name for each export method so the build configure itself with the profile:

# method could be 'ad-hoc' or app-store

update_code_signing_settings(profile_name: "My export method profile")
build_app(export_method: method)

Answered By – Daniel Gomez Rico

Answer Checked By – David Marino (FlutterFixes Volunteer)

Leave a Reply

Your email address will not be published. Required fields are marked *