Post

Replies

Boosts

Views

Activity

How do I use environment variables at build time?
I have an app that relies on a REST like API and want to be able to set a default value for the server but also be able to override that value via environment variables at build time. The idea is that by default it would make calls to localhost but when I run UI Tests on Xcode cloud I'd point it at a test server and then when I hit the phase to archive the binary I'd provide it with either the staging server or production server. Of course the other question is is this the best way to do it or should I be using schemes instead, though that would code the addresses into the project and I like the ability to change the url outside of the project
2
0
1.1k
Jan ’23