r/iOSProgramming • • Oct 31 '20

Discussion Efficiently debugging code using Xcode Breakpoint

207 Upvotes

11 comments sorted by

View all comments

13

u/SirensToGo Objective-C / Swift Oct 31 '20

You can also do all of this from the lldb itself:

  1. Set a breakpoint somewhere (br s -n "-[Class func]")

  2. Configure the condition with breakpoint modify -c '<<condition>>' 1

  3. Configure expressions to evaluate/actions to perform when the breakpoint is hit with breakpoint command add <<breakpoint ID>>

Knowing how to use lldb for this is really great because not only can it be faster, but Xcode's graphical debugger breaks ALL THE TIME and gives slow and sometimes inaccurate information. lldb directly is faster and also works well on all sorts of different languages

1

u/shubham_iosdev Oct 31 '20

Oh okay, I still haven't explored lldb a lot. Thanks you sharing.

I completely agree, knowing how to do anything via code like say git, is always quicker and efficient :D