Xcode offers developers a mature development environment with a powerful debugger. Under the hood, Xcode's debugging tools take advantage of LLDB, the debugger of the LLVM project. It isn't necessary to have a deep understanding of LLDB or LLVM to make use of Xcode's debugging tools, but it certainly doesn't hurt to become familiar with LLDB or LLVM.
In this video, we explore the debugging tools Xcode ships with by debugging Thunderstorm, the app we build in Mastering MVVM with SwiftUI. Download the source files if you want to follow along.
You can only debug an app if you run it in the simulator or on a device. When you run an app, an instance of the app is instantiated. We commonly refer to the instance as a process and it is the process we debug during development. The terms app and process are often used interchangeably. That is fine as long as you understand the difference.
When you run an app in Xcode, the debugger is automatically started and attached to the process of the app. Click the Run button at the top or press Command + R. From the moment the app is up and running, we can start inspecting the process and, if necessary, debug it.
The first change you notice when the app is running and Xcode's debugger is attached to the app's process, is the Debug Area at the bottom. What you see depends on the configuration of your Xcode installation, but you should see, at the very least, the debug bar appear at the bottom of the window.