I am running my xctests
using xcodebuild and need to pass in some environment variables
.
In the example below ACCOUNT_ID
and HOST_URL
.
I tried passing in the variables as both environment variable and accessing them from the test using getenv ("ACCOUNT_ID")
xcodebuild -project CalculatorTestClient.xcodeproj -scheme CalculatorTestClient -destination '%s' ACCOUNT_ID=%s HOST_URL=%s test"
And passing them in as user defaults
and accessing them using [[NSUserDefaults standardUserDefaults] valueForKey:@"HOST_URL"];
xcodebuild -project CalculatorTestClient.xcodeproj -scheme CalculatorTestClient -destination '%s' ACCOUNT_ID=%s HOST_URL=%s test"
Neither approach worked for me. What is easiest way to pass user defined variables from commandline?