【发布时间】:2014-06-10 16:17:16
【问题描述】:
我正在使用 xcodebuild 运行我的 xctests,需要传入一些 environment variables。
在下面的示例中ACCOUNT_ID 和HOST_URL。
我尝试将变量作为环境变量传递并使用getenv ("ACCOUNT_ID")从测试中访问它们
xcodebuild -project CalculatorTestClient.xcodeproj -scheme CalculatorTestClient -destination '%s' ACCOUNT_ID=%s HOST_URL=%s test"
并将它们作为user defaults 传递并使用[[NSUserDefaults standardUserDefaults] valueForKey:@"HOST_URL"]; 访问它们
xcodebuild -project CalculatorTestClient.xcodeproj -scheme CalculatorTestClient -destination '%s' ACCOUNT_ID=%s HOST_URL=%s test"
这两种方法都不适合我。 从命令行传递用户定义变量的最简单方法是什么?
【问题讨论】:
标签: ios xcodebuild xctest