Use the Breakpoint navigator to add breakpoints to your project to pause when certain types of events occur, such as exceptions, Swift errors, and test failures.
Click the Add button (+) at the bottom of the Breakpoint navigator.
Choose Exception Breakpoint from the pop-up menu.
In the configuration dialog, choose the type of exception on which you want execution to stop from the Exception field pop-up menu:
All: Stop on all exceptions.
Objective-C: Stops on Objective-C exceptions.
C++: Stops on C++ exceptions. To stop on a particular C++ exception, you must specify the exception name.
Choose whether execution should halt when an exception is thrown or caught.
Optionally, configure breakpoint actions to run when the breakpoint is encountered, and set other breakpoint options.
Click the Add button (+) at the bottom of the Breakpoint navigator.
Choose Swift Error Breakpoint from the pop-up menu.
Optionally, Control-click the breakpoint, choose Edit Breakpoint, and configure the behavior of the breakpoint. You can set it to halt execution on a specific type of Swift error, rather than all Swift errors (the default). You can also configure actions to run when the breakpoint is encountered, and set other breakpoint options.
Xcode can automatically pause when your app encounters an OpenGL ES error.
Click the Add button (+) at the bottom of the Breakpoint navigator.
Choose OpenGL ES Error Breakpoint from the pop-up menu.
To pause only if an expression evaluates to true, enter the expression in the Condition field.
Optionally, configure actions to run when the breakpoint is encountered, and set other breakpoint options.
Click the Add button (+) at the bottom of the Breakpoint navigator.
Choose Symbolic Breakpoint from the pop-up menu.
Enter a method or function name in the Symbol field. For example:
A method name: pathsMatchingExtensions
.
A method of a particular class: [SKTLine drawHandlesInView]
, people::Person::name()
.
A function name: _objc_msgForward
.
If the symbol is declared in more than one library (a collection of related symbols), enter the name of the appropriate library in the Module field.
To pause only if an expression evaluates to true, enter the expression in the Condition field.
Optionally, configure actions to run when the breakpoint is encountered, and set other breakpoint options.
Click the Add button (+) at the bottom of the Breakpoint navigator.
Choose Test Failure Breakpoint from the pop-up menu.
Optionally, configure actions to run when the breakpoint is encountered, and set other breakpoint options.