jerboa
jerboa

Reputation: 61

Detecting if iOS app is run in debugger in a release build

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.

Upvotes: 0

Views: 1757

Answers (1)

Brandon Stillitano
Brandon Stillitano

Reputation: 1736

This block will work and is production safe.

#if DEBUG
    //Do something on debug
#else
    // Do something on prod
#endif

Upvotes: 2

Related Questions