Features
- Breakpoint Management - Set, disable, and manage breakpoints
- Variable Inspection - Examine variable values during execution
- Call Stack - Explore threads and the entire app call stack
- Console Output - View application logs during debugging (OSLog)
- Step Controls - Step over, into, and out of functions
- Expression Evaluation - Evaluate Swift expressions in context
Getting Started
1
Open your project
Open your iOS project in VS Code
2
Set breakpoints
Click in the gutter next to line numbers to set breakpoints
3
Choose target
Select your scheme and target (simulator or device)
4
Start debugging
Press
F5 and select FlowDeck (LLDB) from the listDebugging Controls
Toolbar Actions
- Continue (
F5) - Resume execution - Step Over (
F10) - Execute current line - Step Into (
F11) - Enter function calls - Step Out (
⇧F11) - Exit current function - Restart (
⇧⌘F5) - Restart debug session - Stop (
⇧F5) - End debugging
Breakpoint Types
Standard Breakpoints
Click in the gutter or pressF9 on any line.
Conditional Breakpoints
Right-click a breakpoint and select Edit Breakpoint:- Expression - Break when condition is true
- Hit Count - Break after N hits
- Log Message - Log without stopping execution
Exception Breakpoints
In the Breakpoints panel:- Add All Exceptions breakpoint
- Add Swift Error breakpoint
- Add Objective-C Exception breakpoint
Debug Console
The debug console allows you to:- View application output
- Execute LLDB commands (prefix with
-exec) - Evaluate Swift expressions
- Inspect variables with
pocommand
Useful LLDB Commands
Variables Panel
The Variables panel shows:- Locals - Variables in current scope
- Globals - Global variables
- Statics - Static variables
- Copy value
- Copy as expression
- Add to watch
- Set value
Watch Expressions
Add expressions to monitor:- Click + in Watch panel
- Enter Swift expression
- View updated values at each breakpoint
Advanced Configuration
For custom debug configurations and launch options, see Debug Configuration.Tips for Effective Debugging
- Use conditional breakpoints to avoid stopping unnecessarily
- Watch key variables to track state changes
- Check the call stack to understand execution flow
- Use log points for non-intrusive debugging
- Leverage LLDB commands for advanced inspection
Troubleshooting
Breakpoints Not Hit
- Ensure Debug build configuration
- Check optimization settings are disabled
- Verify source maps are generated
Variables Not Visible
- Build with debug symbols enabled
- Check you’re in Debug configuration
- Ensure optimization is turned off
Debugger Won’t Attach
- Restart VS Code and simulator
- Clean build folder
- Check for conflicting debugger instances
