Xcode ToolsMidMCQ

What is `LLDB` and what are useful commands?

Test your knowledge:

Explanation & Code

Answer: LLDB is the debugger built into Xcode. When paused at a breakpoint, you can type commands in the console to inspect and modify the running app.

Most useful commands:

# Print object description
po viewModel
po viewModel.items.count

# Print raw value
p frame.size.width

# Modify a value while paused
expr isLoading = true
expr (void)[self.tableView reloadData]

# Print backtrace (call stack)
bt

# Move up/down the call stack
up
down

# List all local variables
frame variable

# Continue execution
c

# Step over next line
n

# Step into function call
s

# Step out of current function
finish

# Set a breakpoint from console
breakpoint set --name viewDidLoad
br s -n "URLSession"

Rate your understanding:

Ready to practice more Xcode Tools?

Test yourself with our interactive quiz mode or browse all curated questions for this topic.