TARGET_OS_SIMULATOR is defined on the device (but defined to false). The fix is:
#include <TargetConditionals.h> // required in Xcode 8+
#if TARGET_OS_SIMULATOR
NSString * const Mode = @"Simulator";
#else
NSString * const Mode = @"Device";
#endif
Not sure when this was changed. I’m fairly sure it was possible to use ‘ifdef’ in the past.