How can I access Bitrise Env Variables in my Swift code?

I’m trying to run my UI test via xcode-test. In my test Swift code, I tried to access to Bitrise Env variables, unfortunately it returns nil always.

let blah = ProcessInfo.processInfo.environment["blah_blah"]

Hi @arash01,
previously our carthage step was written in swift and the step inputs are passed as env vars in steps.
We used this code: https://github.com/bitrise-steplib/steps-carthage/blob/d956cbaae5af18832a049a8f7926cf4e67248318/step-swift3.swift#L12-L18.

Thanks for reply. That is the same code I tried to get environment variables. Unfortunately value is always null in UI Test process.
P.S. This code works fine with Xcode local environment variables but not with Bitrise env variables.

@arash01 what do you mean by Xcode local env vars? Can you share a screenshot or step by step reproduction?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.