The previous post was about a few powerful and useful lldb commands we can use to help our debugging process. This article is about how Xcode can help

A few useful Xcode debugging tricks

submited by
Style Pass
2021-08-17 09:30:04

The previous post was about a few powerful and useful lldb commands we can use to help our debugging process. This article is about how Xcode can help us in debugging process. Last time I mentioned that we can work with lldb commands in a more convenient way. This post, beyond any doubt, will prove my point.

⚠️ If you missed the previous post A few useful lldb tricks I encourage you to check it out before going further. It explains in detail lldb commands I will use in this post.

It's useful but to make it happen constantly we would have to paste the same command over and over again. I would prefer to add regular print in code. But as promised, we can do better, without printing in code.

Let's place a breakpoint somewhere in the viewDidLoad() function i.e. in super.viewDidLoad() line. Instead of running the application, we double-tap on the breakpoint first:

There is a bunch of interesting things here. We can set a condition and the breakpoint will trigger when it's met or set how many times the breakpoint will be ignored before stopping the execution. But what we are looking for is Add Action button. When we tap it:

Leave a Comment