Running Xcode projects in a standalone LLDB session

To debug an Xcode project, we first need the path of the debug build, which we can get by right-clicking on the Products folder in the Project Navigator, and selecting Show in Finder:

Now add that path as the argument to the lldb command (dragging the build from the Finder into the Terminal window is a pretty quick way to do that):

 ~ lldb /Users/.../Build/Products/Debug/5623_18_code.app

Hit return. This will produce something similar to the following output:

(lldb) target create"/Users/.../Build/Products/Debug/5623_18_code.app"Current executable set to '/Users/.../Build/Products/Debug/5623_18_code.app' ...

Get Mastering macOS Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.