Skip to content

How to create exception breakpoint in Xcode

Published: at 03:35 AM

Exception breakpoints are powerful debugging tools available in Xcode that can significantly help debugging process. When your app crashes, sometimes the standard stack trace doesn’t always provide a clear picture of where or why the exception occurred. Especially when the crash is caused by third party library or package.

How to create an exception breakpoint

  1. Open the Breakpoint navigator. You can use CMD + 8
  2. On the bottom left, click on + button and choose Symbolic breakpoint
  3. Give name of the breakpoint, choose to break On Throw or On Catch.
  4. You can also add actions to perform when the breakpoint is hit (e.g., log message, sound, shell command)

Exception breakpoint is excellent choices when you want to debug strange crash. In my case, it helps me debug 3rd party library which has initial setup at the AppDelegate level. Since the SDK isn’t properly configure, it crash the app even before the app launched.

References: