You can set environment variables via Xcode Schemes. To edit a scheme, select it in the top bar:
Choose the Run mode and go to the Arguments tab, and there you go...
By default, these settings are also used for the Test and Profile modes.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…