Xcode cloud - access to environmental variables inside a test's code

I run my tests on xcode cloud and I want to change different configurations when the tests run on the cloud as opposed to when the run locally. I thought environmental variables should be the way, but I'm not sure how to access them. I tried:

ProcessInfo.processInfo.environment["CI"]

But didn't get any result. Any ideas how can it be done?

@noamohana where you able to figure it out?

I was able to get it to work by doing two things.

  1. Forward the environment variables in your scheme

  1. Copy the Xcode Cloud variables to the environment in ci_pre_xcodebuild.sh

Perhaps if I use $($CI) in the scheme you don't need step #2, but I haven't tested it.

Xcode cloud - access to environmental variables inside a test's code
 
 
Q