I can’t seem to find a clear explanation on how to test my secrets locally.
I have the bitrise.yml and .bitrise.secrets.yml. I run bitrise run test and in my test workflow and the script runs fine and shows REDACTED. But when I run xcode test after it doesn’t replace my environment variables with the secrets I gave it and fails my test. I then tried adding it to the secrets on workflow with no luck.
How I call the environment variables:
if let key = ProcessInfo.processInfo.environment["SECRET_KEY"] {
return key
}
I even tried adding Swift Environment Variable Injection right before xcode test and changing how I call the environment variable as suggested in the docs but that doesn’t work as well. I saw in an article, suggesting to add it to the environment variables in the scheme but then that’s in source control and defeats the purpose of doing the .bitrise.secret.yml file.
Another issue is I also tried redirecting the deploy to bitrise to see the problems when the test fails and it’s not working for me. This is what I have in my bitrise.yml
- deploy-to-bitrise-io:
inputs:
- deploy_path: /var/system.log
My question is how can I get the deploy_path to show the output in this file and, more importantly, how can I run my iOS tests locally with bitrise secrets?
Seems like it should be doable as that’s the point of the .bitrise.secrets.yml but I just can’t seem to find the solution.

