Xcode keyboard shortcuts
Xcode is Apple's IDE for building apps across iPhone, iPad, Mac, Apple Watch, and Apple TV. Between its navigators, inspectors, assistant editors, and simulators there is a lot of interface to wrangle. Learning the keyboard shortcuts keeps your hands off the trackpad and your focus on Swift, not on window management. This cheat sheet covers 58 default shortcuts.
Build, Run & Test
| Build | Cmd+B |
| Run | Cmd+R |
| Stop running | Cmd+. |
| Run tests | Cmd+U |
| Clean build folder | Cmd+Shift+K |
| Analyze | Cmd+Shift+B |
| Profile with Instruments | Cmd+I |
Navigation
| Open Quickly (fuzzy file/symbol search) | Cmd+Shift+O |
| Go back | Ctrl+Cmd+Left |
| Go forward | Ctrl+Cmd+Right |
| Jump to definition | Ctrl+Cmd+J |
| Jump to line | Cmd+L |
| Reveal current file in Project navigator | Cmd+Shift+J |
| Move focus (jump bar picker) | Cmd+J |
| Jump to next issue | Cmd+' |
| Jump to previous issue | Cmd+" |
| Open developer documentation | Cmd+Shift+0 |
| Show Quick Help for symbol | Option+Click |
Editing
| Toggle comment on line/selection | Cmd+/ |
| Re-indent selection | Ctrl+I |
| Shift line right | Cmd+] |
| Shift line left | Cmd+[ |
| Move line up | Cmd+Option+[ |
| Move line down | Cmd+Option+] |
| Edit all in scope (rename local symbol) | Ctrl+Cmd+E |
| Show code completion suggestions | Esc |
| Delete to end of line | Ctrl+K |
| Zoom editor text in | Cmd+Plus |
| Zoom editor text out | Cmd+Minus |
Code Folding
| Fold current block | Cmd+Option+Left |
| Unfold current block | Cmd+Option+Right |
| Fold all methods and functions | Cmd+Option+Shift+Left |
| Unfold all methods and functions | Cmd+Option+Shift+Right |
Find & Replace
| Find in file | Cmd+F |
| Find and replace in file | Cmd+Option+F |
| Find in workspace | Cmd+Shift+F |
| Find and replace in workspace | Cmd+Option+Shift+F |
| Find next | Cmd+G |
| Find previous | Cmd+Shift+G |
| Use selection for find | Cmd+E |
Debugging
| Toggle breakpoint on current line | Cmd+\ |
| Activate/deactivate all breakpoints | Cmd+Y |
| Pause/continue execution | Ctrl+Cmd+Y |
| Step over | F6 |
| Step into | F7 |
| Step out | F8 |
Workspace & Panels
| Show/hide Navigator panel | Cmd+0 |
| Show Project navigator | Cmd+1 |
| Show/hide Inspectors panel | Cmd+Option+0 |
| Show/hide Debug area | Cmd+Shift+Y |
| New tab | Cmd+T |
| Next tab | Cmd+Shift+] |
| Previous tab | Cmd+Shift+[ |
| Close file/tab | Cmd+W |
| Toggle full screen | Ctrl+Cmd+F |
SwiftUI & Source Control
| Show/hide SwiftUI canvas | Cmd+Option+Enter |
| Resume/refresh SwiftUI preview | Cmd+Option+P |
| Commit changes | Cmd+Option+C |
Put your top Xcode shortcuts on real keys
The five Xcode actions most worth binding to a physical macropad key:
Cmd+R Run The build-run-check loop is the heartbeat of iOS development; a physical run key removes all friction.
Cmd+. Stop running Instantly kills the simulator session so you can edit and re-run without reaching for the mouse.
Cmd+Shift+K Clean build folder The ritual fix for stale-build weirdness deserves its own panic button.
Cmd+Shift+O Open Quickly Single-press access to any file or symbol beats scrolling the navigator every time.
Cmd+\ Toggle breakpoint Dropping and clearing breakpoints dozens of times per debug session earns a hardware key.
I hand-build small-batch programmable macropads (QMK/VIA) in Barcelona. One press, any shortcut, any app.
Xcode shortcut FAQs
How do I quickly open a file in Xcode without the Project navigator?
Press Cmd+Shift+O for Open Quickly, then type part of the file, type, or symbol name. It fuzzy-matches across the whole workspace, including SDK headers.
What is the shortcut to refresh the SwiftUI preview in Xcode?
Press Cmd+Option+P to resume or refresh the preview canvas. Cmd+Option+Enter shows or hides the canvas itself.
How do I rename a variable everywhere in its scope in Xcode?
Place the cursor on the symbol and press Ctrl+Cmd+E (Edit All in Scope). Typing then updates every occurrence in that scope simultaneously. For project-wide renames, use the Refactor > Rename menu.
How do I clean the build folder in Xcode?
Press Cmd+Shift+K to clean the build folder. This deletes intermediate build products and is the classic first fix for mysterious build errors.
Can I customize keyboard shortcuts in Xcode?
Yes. Go to Xcode Settings > Key Bindings, where every command can be rebound. You can also duplicate the default key binding set to keep your changes separate.