从fastlane更改用户定义的变量

时间:2016-07-12 12:24:58

标签: xcode fastlane

我的Xcode项目中有一个用户定义的变量 - MY_VARIABLE
enter image description here 我还在我的.plist文件中链接了MY_VARIABLE
enter image description here 然后我在我的代码中使用它:
NSString *myVariable = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"MY_VARIABLE"];

在fastfile中我有我的AppStore通道,只有在这种情况下,我想更改MY_VARIABLE的值。

我目前正在使用:
ENV["MY_VARIABLE"] = "appStoreValue"
但这不起作用。

1 个答案:

答案 0 :(得分:3)

经过一番研究后,我找到了解决方法 我在xcargs操作中使用gym,例如:

gym(
  scheme: "MyScheme",
  configuration: "Release",
  use_legacy_build_api: 1,
  xcargs: "MY_VARIABLE=appStoreValue"
)