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

问题描述

Xcode Scheme

我们在方案中有四个构建配置-QA,预生产,登台,使用不同的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")

解决方法

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

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

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