How do you debug an issue with a release mode build in iOS?

Normally Debug builds have optimisation disabled (-O0) to make debugging easier, whereas Release builds have optimisation enabled (-O3 or -Os), which makes the code run much faster, but also makes debugging harder (but not impossible). You can just go into the build settings in Xcode in the Debug configuration and temporarily turn up the optimisation level - this will keep all the other debug goodies (symbols etc) but hopefully also flush out the Release mode bug. (Don't forget to reset the optimisation level to -O0 in the Debug configuration when you're done!)


  1. Go to "Project" command in an Xcode application menu and chose "Edit Scheme"(Shortcut: ⌘< )
  2. Select "Run Project name" in left pane
  3. In right pane, under "Info" tab change "Build Configuration" to "Release"

You can not run an app in release mode while have having debugging turned on. That is not intended.

When running an app in release mode you have to find a different way to observe the behaviour of your app (e.g. using alerts).

Uncheck <code>Debug executable</code> do run your app in release mode

Additionally you will have to trust the distribution profile on your device. Xcode will notify and guide you with an alert message on the first run.


To debug an iOS application in release mode modify the settings: Build Settings -> Deployment -> Deployment Post Processing -> Release -> set value as "NO"

Set 'Deployment Post Processing: Release' value as 'No'