Setting breakpoints on all methods in XCode

No comments on Setting breakpoints on all methods in XCode

Written by

in

To be able to set breakpoints on all methods do the following:

  1. Switch to LLDB debugger. Go to Edit Schemes, click Run, on Info panel choose this debugger.
  2. Run your app, pause it and type the following on log:
    breakpoint set -r . -s  
    

    Here, “.” is a regular expression, where to put breakpoints. In this case it will put everywhere on everymethod. “-s” means that breakpoints will be put only in your project files, not frameworks.

  3. “br list” command allows to look at all breakpoints list. You can’t see them on Xcode UI and they will be removed after the next Run.

Using LLDB we can put breakpoint on all ViewDidLoad methods by name, for example.

(lldb) breakpoint set -n ViewDidLoad

Also, we can put breakpoints by selector name:

(lldb) breakpoint set -S alignLeftEdges:

Inspired by this solution.

More about LLDB debugger.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *