如何在 Fastlane 中更改构建配置 - 通过 gym 、 build _app 或 xcodebuild

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

我们在方案中有四种构建配置 - QA、Pre prod、Staging、Releasing,使用不同的 BaseUrl,我只是想通过 Fastlane gym 命令更改此构建配置,但它失败了,但默认情况下拿选的PFA做参考

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")

您可以尝试添加一个单独的 gym 文件,您可以在其中定义 gym 变量,如下所示:

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

然后你会在没有任何参数的情况下调用 gym 命令,但我不禁注意到你的 " 放错了地方,("appstore,configuration:") 也许修复它也可以