I'm trying to enable/disable parts of my code based on whether or not the code be being run via USB/Xcode (debug), or in production mode downloaded from the app store (release). I'm aware of checking if it is running in DEBUG
or RELEASE
mode like this:
#ifdef DEBUG
// Stuff for debug mode
#else
// Stuff for release mode
#endif
but the problem is that an obvious loop-hole I see is you can change the Build Configuration for the 'Run' build scheme from 'Debug' to 'Release'. A better way would be if I can simply detect if it is running from Xcode or not. I haven't found a way to check for this.
Is there a way to check if an iOS app is running from Xcode or not?