Building, running and testing 5
Holding Control turns the scheme action button in the toolbar into its “without building” variant for one use.
| Action | Mac |
|---|---|
| Run Without BuildingLaunches the last build again, which saves the wait when nothing in the code changed. | Ctrl+Cmd+R |
| TestRuns every test in the project and marks each one with a green check or a red x. | Cmd+U |
| Test Without BuildingStarts the tests again from the existing build, useful when the code has not changed. | Ctrl+Cmd+U |
| Test AgainRepeats the previous test run from wherever you are, with no need to find its test diamond. | Ctrl+Option+Cmd+G |
| ProfileSame as Product > Profile: begins a performance analysis of the app in Instruments. | Cmd+I |
Tabs, canvas and project files 15
| Action | Mac |
|---|---|
| Show or hide the canvasToggles the preview canvas next to the source editor. | Option+Cmd+Return |
| Resume PreviewDoes the same as clicking the resume button of a preview that has stopped updating. | Option+Cmd+P |
| Show LibraryOffers SwiftUI views, colors and images to insert; Esc closes it again. | Shift+Cmd+L |
| SettingsIts Intelligence pane is where the coding model is chosen. | Cmd+, |
| Open a file in a new tabNavigation settings decide whether the tab that appears is pinned or unpinned. | Option+Click |
| Close all other tabsClick the close button of the one tab you want to keep. | Option+Click |
| Open the contextual menuOn a token in the editor it lists the commands that Code Actions used to hold. | Ctrl+Click |
| Scroll or zoom the canvas itselfScroll and zoom input goes to the canvas while Command is held; a toggle in Editor > Canvas turns this off. | Cmd+Scroll |
| Open the structured editing popoverClick an element in the preview; the popover includes Show SwiftUI Inspector. | Ctrl+Cmd+Click |
| Simulate a pinch gestureStands in for a two-finger pinch on the preview shown in the canvas. | Option+Drag |
| Copy an item in the navigatorGives a new file the format of an existing one without copy and paste. | Option+Drag |
| Select several filesIn the Project navigator, each click adds another file to the selection. | Cmd+Click |
| Collapse sibling resultsClick the disclosure arrow of one file in the Find navigator to fold the matches of every file. | Cmd+Click |
| Delete selected file or folderXcode then asks how the selected items should be removed from the project. | Delete |
| Reset a build settingSelect the modified setting, shown in bold, at the level where it was overridden. | Delete |
Editing code 20
The completion key can be reassigned; Apple's Xcode 27 documentation gives the place as Xcode > Settings > Shortcuts.
| Action | Mac |
|---|---|
| Jump to Next PlaceholderMoves to the following argument placeholder that code completion or a snippet inserted. | Tab |
| Jump to Previous PlaceholderGoes back one placeholder in the inserted method call or snippet. | Shift+Tab |
| Accept predicted codeTakes the inline prediction that Xcode offers while you type in a Swift file. | Tab |
| Accept the full predictionHolding Option expands a predictive completion to its entire length before you take it. | Option+Tab |
| Insert selected completionAdds the highlighted item of the completion list to the code; a double-click does the same. | Return |
| Complete with all argumentsChoose a completion with Option held to fill in every argument of the call. | Option+Return |
| Show CompletionsNeeded when completion is set to On Demand; Esc does the same job while typing. | Ctrl+Space |
| Show or hide completionsDismisses the suggestion list while you type, or brings it back. | Esc |
| Move through completion listXcode describes the highlighted item underneath the list. | UporDown |
| Step through issues in a popoverApplies when one line carries several issues; Esc closes the popover. | UporDown |
| Edit All in ScopeSelect a symbol first; it and every other use of it in the open file are renamed together. | Ctrl+Cmd+E |
| Format to Multiple LinesSplits code over several lines; Apple added the command to Editor > Structure in Xcode 15. | Ctrl+M |
| Add a cursorEach click places another insertion point, so one edit lands in several places at once. | Ctrl+Shift+Click |
| Add cursors at matching textWith some text selected, finds the same text elsewhere and puts a cursor there for multi-cursor editing. | Option+Cmd+E |
| Move by word | Option+Arrow keys |
| Move by subword | Ctrl+Arrow keys |
| Move to line start or endDoes what Home and End do on keyboards that have those keys. | Cmd+LeftorCmd+Right |
| Emacs-style cursor keysPart of the native macOS text editing commands that the source editor supports. | Ctrl+AorCtrl+EorCtrl+PorCtrl+N |
| Move Line Up | Option+Cmd+[ |
| Move Line Down | Option+Cmd+] |
String Catalog editor 4
| Action | Mac |
|---|---|
| Move up one rowKeeps the focus in the same column of the catalog. | Cmd+Up |
| Move down one rowEither key goes to the row below without leaving the column. | Cmd+DownorReturn |
| Move sideways through fieldsBoth move horizontally, where the Command keys of this editor move vertically. | TaborShift+Tab |
| Type a newline or tabPlain Return and Tab move the focus on to the following text field instead. | Option+ReturnorOption+Tab |
Metal acceleration structure viewer 12
Apple's table also offers the Up and Down arrows as alternatives to W and S for zooming, while another row of the same table assigns them to panning.
| Action | Mac |
|---|---|
| Zoom inCentres the zoom on the middle of the scene view rather than on the pointer. | W |
| Zoom outThe counterpart of W, also centred on the viewport. | S |
| Pan left | AorLeft |
| Pan right | DorRight |
| Pan up or down | UporDown |
| Zoom at the pointerUp moves closer and Down moves away, centred where the pointer is. | Option+UporOption+Down |
| Rotate the cameraWith the Orbit camera the same drag circles the primitive under the pointer. | Drag |
| Select in the scene viewWhat gets picked depends on the selection mode that is active. | Ctrl+Click |
| Select a primitive structure | Ctrl+Shift+Click |
| Select the geometry | Ctrl+Option+Click |
| Select a primitiveAlso reveals that primitive in the structure outline on the left. | Ctrl+Option+Cmd+Click |
| Select an instance | Ctrl+Cmd+Click |
No row on this page matches that filter.
Notes
What Apple documents and what it leaves to the app
Apple publishes no keyboard shortcut list for current Xcode. Its documentation says that most commands can be performed from the menus in the menu bar and tells readers to look at the menu items for the keys. That is why Build, Run, Stop, Clean Build Folder, most of the navigator number keys and the debugger step keys are not in the tables: no current Apple text states them. Read them off the Product, View and Debug menus, or search for a command in the Settings window, which Cmd + , opens.
Running and testing without a rebuild
Cmd + U runs the tests of the project. The Control variants skip the build step and start from the last build: Ctrl + Cmd + R runs the app again and Ctrl + Cmd + U runs the tests again, which helps when a crash or a failing test has to be walked through several times with no code change in between. Ctrl + Option + Cmd + G repeats the previous test run from any file, and Cmd + I starts a profiling run in Instruments.
Getting around a large project
Shift + Cmd + O is Open Quickly: type part of a file or symbol name and jump to it; pressing Option + Return on a result opens it in a split next to the current file. Cmd + Click on a token jumps to its definition, the default since Xcode 15, and Option + Click shows Quick Help for it. Shift + Cmd + J finds the open file in the Project navigator, and Shift + Cmd + A opens Quick Actions, a search over Xcode's commands for everything that has no key you remember.
Completion and multiple cursors
Tab accepts the inline prediction and Option + Tab the whole of a longer one; in the completion list, Return inserts the highlighted item and Option + Return inserts it with all of its arguments. Ctrl + Space or Esc asks for completion when it is set to On Demand. For repeated edits, Ctrl + Shift + Click adds a cursor at each place you click, Ctrl + Cmd + E renames a symbol throughout the current file, and Ctrl + M spreads code over several lines.
The coding assistant keys in Xcode 27
Apple's Xcode 27 documentation prints Cmd + 0 for the Coding Assistant and its conversation sidebar, and Option + Cmd + 0 for the coding tools popover in the source editor. Older shortcut lists give those two keys to showing and hiding the navigator and the inspectors, so check the View menu of the Xcode version you run before relying on either meaning.
Questions
Where does Xcode list all its shortcuts?
In the Settings window, which Cmd + , opens. The pane is known as Key Bindings and is called Shortcuts in Apple's Xcode 27 documentation; it lists the commands with their keys and lets you change them. Each menu item also shows its key.
Why are Build, Run and the debugger step keys not on this page?
The page only lists keys that Apple states in its own current text, and Apple's Xcode documentation does not print those; it refers readers to the menu items instead. Look at the Product and Debug menus in Xcode for them.
What is the difference between Run and Run Without Building?
Run builds the app first and then launches it. Ctrl + Cmd + R launches the existing build without compiling, which is quicker when the source has not changed.
How do I open a file by name in Xcode?
Shift + Cmd + O (Open Quickly). Type part of a file name or symbol name and choose from the matches.
Which key brings up code completion when Xcode does not offer it by itself?
Ctrl + Space, or Esc while typing. This is the way to ask for suggestions when completion is set to On Demand in Xcode's settings.
Which Xcode version do the keys on this page come from?
The documentation pages are the current edition for Xcode 27. The tutorial pages carry no version, each release-notes row names its release (Xcode 15, 16, 26 or 27), and the two WWDC session transcripts describe Xcode 16 (2024) and Xcode 15 (2023).
Sources and checks
- Apple Developer Documentation — Xcode: Editing source files in Xcode (current edition, Xcode 27)
- Apple Developer Documentation — Xcode: Fixing issues in your code as you type (current edition, Xcode 27) Code completion list and issue popover keys
- Apple Developer Documentation — Xcode: Finding and refactoring code (current edition, Xcode 27) Open Quickly and Find
- Apple Developer Documentation — Xcode: Using coding intelligence in the source editor (current edition, Xcode 27) Coding tools popover
- Apple Developer Documentation — Xcode: Writing code with intelligence in Xcode (current edition, Xcode 27) Coding Assistant
- Apple Developer Documentation — Xcode: Writing symbol documentation in your source files (current edition, Xcode 27) Quick Help pop-over and inspector
19 more source pages
- Apple Developer Documentation — Xcode: Analyzing the performance of your Metal app (current edition, Xcode 27) Profile
- Apple Developer Documentation — Xcode: Managing files and folders in your Xcode project (current edition, Xcode 27) Deleting files in the Project navigator
- Apple Developer Documentation — Xcode: Configuring the Xcode project window (current edition, Xcode 27) Apple's pointer to the menu bar for keyboard shortcuts
- Apple Developer Documentation — Xcode: Inspecting acceleration structures (current edition, Xcode 27) Scene view controls of the Metal debugger's Acceleration Structure viewer
- Apple Developer Documentation — Xcode: Configuring the build settings of a target (current edition, Xcode 27) Restoring a build setting
- Apple Developer — App Dev Tutorials: Using stacks to arrange views Showing and hiding the canvas
- Apple Developer — App Dev Tutorials: Decoding structured JSON Test
- Apple Developer — SwiftUI Tutorials: Creating and combining views Structured editing popover in a preview
- Apple Developer — SwiftUI Tutorials: Handling user input Moving lines of code up and down (keys printed as { and })
- Apple Developer — Develop in Swift Tutorials: Discover coding intelligence Settings window
- Apple Developer — Develop in Swift Tutorials: Hello, SwiftUI Library and showing or hiding code completion
- Apple Developer — App Dev Tutorials: Adding the detail view Pinch gesture in the canvas
- Apple Developer — SwiftUI Tutorials: Creating a macOS app Selecting several files in the Project navigator
- Apple Developer Documentation — Xcode 15 Release Notes Jump to Definition click, contextual menu, Format to Multiple Lines, String Catalog text entry
- Apple Developer Documentation — Xcode 16 Release Notes String Catalog keyboard navigation
- Apple Developer Documentation — Xcode 26 Release Notes Resume Preview and opening files in new editor tabs
- Apple Developer Documentation — Xcode 27 Release Notes Command-modified input in the preview canvas; Control with the toolbar scheme button
- Apple Developer Videos — WWDC24 session 10181 “Xcode essentials”, transcript (Xcode 16) Keys the Xcode team names in the session: navigators, Quick Actions, multi-cursor and text movement, running and testing without building
- Apple Developer Videos — WWDC23 session 10252 “Build programmatic UI with Xcode Previews”, transcript (Xcode 15) Adding cursors at matching text
Every row on this page was matched to a line in the documentation above on . A binding that could not be found there is not listed.
47 rows from the earlier version of this page were removed in that check: duplicates, and bindings the documentation does not list or lists differently.
Found a wrong or missing key? Tell us and it gets checked against the source. How we verify describes the process and its limits.