0

I am working on an SDK that will be used in iOS apps. When I release the SDK, I'd like collect data on whether the applications that are using my SDK are running under the debugger when they are running.

This Apple developer blog post shows how to detect this, but it explicitly calls out that you should only use the code in the debug build of your program. Because I'll be building a release build of the SDK, it seems unsafe to include.

jerboa
  • 51
  • 5
  • Possible duplicate of [Detect if Swift app is being run from Xcode](https://stackoverflow.com/questions/33177182/detect-if-swift-app-is-being-run-from-xcode) – Todd May 31 '19 at 19:55

1 Answers1

1

This block will work and is production safe.

#if DEBUG
    //Do something on debug
#else
    // Do something on prod
#endif
Brandon Stillitano
  • 1,304
  • 8
  • 27