Symbolic Breakpoints (Swift) in Xcode

Symbolic breakpoint is one of the few amazing features of Xcode. It allows you to add a breakpoint against every method in your code - that matches with the name of your breakpoint. This means you don't need to worry about method signature or which module it belongs to, whether it is a public or a private api.

Do it yourself

  1. Open your xcode project
  2. Goto breakpoint navigator
  3. Click on the + button at lower left corner
  4. Select "Symbolic Breakpoint..."
  5. A new breakpoint will be added to the list and a pop-up window will ask you to fill in details.
  6. Add the name of your method and press enter to create your symbolic breakpoint.
  7. Run the app and you will see your breakpoint changing into a list of all method names that is indexed by Xcode.
  8. If your breakpoint is for a private api - you may not see this list but be assured that the debugger will pause when it hits your method.

Demo

Advanced Options

You can also restrict your symbolic breakpoint to a particular framework or module. This enables you to avoid a lot of noice (if your method name is very common).

restricting-to-module

Show Comments