Approach 1: By the means of GCC_PREPROCESSOR_DEFINITIONS
You have to make use of GCC_PREPROCESSOR_DEFINITIONS on xcodebuild command line.
Here is a sample macro in your code
#ifdef Flavour1
NSLog(@"This is flavour 1");
#endif
and Here is how you pass the macro through command line
xcodebuild -verbose -scheme "YourAppScheme" GCC_PREPROCESSOR_DEFINITIONS='$GCC_PREPROCESSOR_DEFINITIONS Flavour1=1'
Approach 2: By the means of separate xcode Scheme
Have a scheme and it's respective target for each flavour. so that it can have different App name,version number,signers etc if required and you can have macro injected in preprocessor definition of build settings in target.
All you have to do is just pass the right scheme in xcodebuild command and that's you sorted
P.S:-
I personally prefer Approach 2 because it's easy to customise without worrying much about xcodebuild command line parameters.