I've written a tutorial for doing that both on CI and for local development via sh scripts and Sourcery. Check this out: https://kazaimazai.com/secret-env-vars-xcode-ci/
Topic:
App & System Services
SubTopic:
Automation & Scripting
Tags: