Never mind... figured out that it is in "Schemes" that you set this.
For example if you want TARGET=TEST to be available during Test and TARGET=RUN to show during run, just set that in your Scheme > Environment Variables > Name/Value.
Then from your app you can do:
[[[NSProcessInfo processInfo] environment] objectForKey:@"TARGET"]
Using build settings with preprocessor macros DID NOT work for me b/c my test target (for application/integration testing) is dependent on my main (not test) target, so the main target is built first and that's what runs, and you end up with main target preprocessor macros even though you are after the ones defined in the target you ran. If I missed something here someone feel free to explain please.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…