How to change the build configuration in Fastlane - via gym , build _app or xcodebuild

3.9k Views Asked by At

Xcode SchemeWe have four build configuration in the scheme - QA, Pre prod, Staging, Releasing with different BaseUrl, I am just trying to change this build configuration via Fastlane gym command but it fails, bu default it is taking the one which is selected PFA for reference

when running via Fastlane gym command it is taking the default value in the scheme example - pre-prod

build_app(workspace: "MyApp.xcworkspace", scheme: "MyApp", include_bitcode: true,export_method:"app-store",configuration: "Staging")

gym(workspace: "Omuni.xcworkspace",scheme: stagingScheme,export_method:"appstore,configuration:"Staging")
1

There are 1 best solutions below

0
On BEST ANSWER

You can try and add a separate gym file where you define your gym variables like so:

scheme("your scheme")
configuration("your configuration")
output_directory("./fastlane/builds")
include_bitcode(true)
include_symbols(false)
export_xcargs("-allowProvisioningUpdates")

and then you would call the gym command without any parameters, but I couldn't help but notice that your " are misplaced, ("appstore,configuration:") perhaps fixing that would do as well