Skip to main content
On this page

VS Code shortcuts and settings for iOS app development

Shortcuts, common commands and every build, debug, editor and code completion setting.

Last updated

VS Code shortcuts for iOS app development match Xcode: Cmd+R builds and runs, Cmd+B builds and Cmd+. stops. Every KXApp setting starts with kxapp.; search for kxapp in VS Code's settings (Cmd+,) to see them all. Below, the ones you're most likely to need are grouped into shortcuts and commands, build and debug, the visual editors and code completion, each with its default value. The defaults suit most projects, so you can leave them alone.

What are the VS Code shortcuts and commands for iOS development?

CommandWhere
Build & RunCmd+R
BuildCmd+B
StopCmd+.
Select Project / Scheme / Build Configuration / Run DestinationStatus bar or the Xcode Project view
Run Without Debugging, Run Without Building, Attach to Running App…Command Palette
Clean Build Folder, Show Build Log, Refresh DevicesXcode Project view title bar
kxapp: Restart Code Completion, kxapp: Re-Index ProjectCommand Palette
Install the xcodeproj Ruby gemCommand Palette

Which settings control building and debugging?

SettingDefaultDescription
kxapp.defaultConfigurationDebugConfiguration used when none is selected
kxapp.build.allowProvisioningUpdatesonLet Xcode create or update provisioning profiles for device builds
kxapp.build.extraArgs[]Extra arguments for every xcodebuild command
kxapp.build.revealOutputoffShow the build log when a build starts
kxapp.build.prepareForCodeCompletiononQuietly build once in the background so dependencies get completion before your first build
kxapp.debug.killAppOnStoponEnd the app when the debug session stops
kxapp.rubyPathemptyRuby used to edit project.pbxproj; empty means ruby on PATH

Which settings control the visual editors?

SettingDefaultDescription
kxapp.plist.defaultSaveFormatpreservePlist save format; preserve keeps the file's format
kxapp.plist.sortKeysOnSaveoffSort dictionary keys alphabetically on save
kxapp.plist.showRootRowonShow a Root row above the top-level keys
kxapp.plist.spacingcompactRow spacing
kxapp.xcassets.deleteUnreferencedFilesaskWhat to do with image files no longer referenced after an edit
kxapp.xcodeproj.defaultModebasicWhich build settings show by default: basic / customized / all
kxapp.xcodeproj.livePreviewonRecompute resolved values while you edit
kxapp.l10n.markSourceEditsForReviewonMark translations as needing review when source text changes
kxapp.l10n.extraMacros[]Extra localization macros to scan when syncing strings

Which settings control code completion?

SettingDescription
kxapp.swiftPathFolder of a different Swift toolchain; empty means the Xcode selected with xcode-select
kxapp.swiftSourcekitLspSupportedLanguagesLanguages handled by SourceKit-LSP
kxapp.swiftSourcekitLspBackgroundIndexingBackground indexing: auto / on / off
kxapp.swiftSourcekitLspServerArgumentsExtra arguments for SourceKit-LSP
kxapp.swiftSourcekitLspDisableTurn code completion off
kxapp.swiftSourcekitLspTraceServerLog traffic with SourceKit-LSP when tracking down a problem

How these VS Code shortcuts and settings are used is explained in build and run iOS apps in VS Code, debug iOS apps on a real iPhone and Swift code completion in VS Code.

Frequently asked questions

Why doesn't Cmd+B build?

Cmd+B and Cmd+R apply only while the editor has focus and an Xcode project is open. If focus is in the side bar or the terminal, click into the editor first.

How do I change the Cmd+R or Cmd+B shortcut?

Open Keyboard Shortcuts in VS Code (Cmd+K Cmd+S), search for kxapp and rebind the command.

Which setting keeps the app running when I stop debugging?

Turn off kxapp.debug.killAppOnStop. It's on by default, so stopping ends the app as in Xcode.

How do I use a different Swift toolchain?

Set kxapp.swiftPath to the toolchain's folder; leave it empty to use the Xcode selected with xcode-select.

Next steps