How can I use flutter's "--obfuscate" flag with fastlane on iOS

791 views Asked by At

I have a fastlane lane that builds the app using gym or build_app but I also want to use flutter build's --obfuscate flag.

  desc "Build - Enterprise"
  lane :build_enterprise do |options|
    bundle_id = options[:bundle_id]

    sync_certificates_and_provisioning_profiles(
      type: "enterprise",
      bundle_id: bundle_id,
    )
    cleanup
    gym(
      scheme: get_scheme(bundle_id),
      export_method: "enterprise",
      clean: true,
      include_bitcode: false,
      include_symbols: true,
      export_options: {
        signingStyle: "manual",
        provisioningProfiles: generate_enterprise_profiles(bundle_id)
      }
    )
  end

As I understand, I can replace gym with flutter build ios --obfuscate but then how can I make use of other parameters that gym provides. Such as: export_method, export_options, include_bitcode, include_symbols? I have multiple flavors in the app and using these parameters based on debug/release app or staging/production app is quite useful.

1

There are 1 answers

0
Peter Musembi On

You can't add this via fastlane-gym. In the project_directory>iOS>Flutter>Generated.xcconfig file add

DART_OBFUSCATION=true