Build configurations, schemes and xcconfig: how to separate Debug, Staging and Release?
Essence
- Build configuration — a set of build setting values:
Debug(no optimizations,DEBUGin compilation conditions, convenient debugging) andRelease(optimizations, dSYM, no debug code). You can add as many as you like, for exampleStaging. - Scheme — what to build and with which configuration for each action: Run, Test, Profile, Analyze, Archive. By default Run and Test use Debug, Profile and Archive use Release. A scheme for CI is marked Shared so it lives in
xcshareddatain the repository. - Target — a product (app, extension, tests) with its own build settings.
The rest of this answer, with code and interview follow-ups, is in the DevPrep app.
Read the full answer in DevPrep