Xcode Selector
Status bar scheme, configuration, and destination picker for Xcode projects in VS Code.
This extension helps you quickly select:
- The active Xcode scheme
- The build configuration (Debug / Release)
- The active destination (simulator or physical device)
Selections are persisted in VS Code workspace state and exposed to build/launch tasks via ${command:...} variable substitution (environment variables).
Features
- Three status bar controls:
- Scheme picker (
$(tools))
- Configuration picker (
$(gear))
- Destination picker (
$(device-mobile))
- Auto-detects an
.xcworkspace in the workspace root
- Optional manual workspace path configuration
- Fast QuickPick behavior with in-memory cache and refresh command
- Destination ID normalization for
xcrun workflows:
- Simulator IDs from
xcrun simctl
- Physical device IDs from
xcrun devicectl
Commands
Xcode: Select Scheme (xcode-selector.selectScheme)
Xcode: Select Configuration (xcode-selector.selectConfiguration)
Xcode: Select Destination (xcode-selector.selectDestination)
Xcode: Refresh Schemes & Destinations (xcode-selector.refresh)
Task Variable Commands
These commands return plain strings for use with ${command:...} substitution in tasks.json:
| Command |
Returns |
xcode-selector.getScheme |
Selected scheme name |
xcode-selector.getConfiguration |
Selected configuration (Debug or Release) |
xcode-selector.getDestinationId |
xcodebuild destination ID |
xcode-selector.getXcrunId |
xcrun-compatible device/simulator ID |
xcode-selector.getDestinationType |
Destination type (iOSSimulator, iOSDevice, etc.) |
Example task using variable substitution
{
"type": "shell",
"label": "xcode: build",
"command": "Scripts/xcode-build.py",
"options": {
"env": {
"XCODE_SCHEME": "${command:xcode-selector.getScheme}",
"XCODE_DESTINATION_ID": "${command:xcode-selector.getDestinationId}",
"XCODE_CONFIGURATION": "${command:xcode-selector.getConfiguration}"
}
}
}
Configuration
Setting:
xcode-selector.workspacePath (string, default: empty)
Behavior:
- If empty, the extension scans the workspace root and uses the first
.xcworkspace it finds.
- If set, it can be:
- A relative path from workspace root (recommended)
- An absolute path
Example in .vscode/settings.json:
{
"xcode-selector.workspacePath": "SafePilot.xcworkspace"
}
Usage
- Open a folder containing an Xcode workspace.
- Click the scheme item in the status bar and choose a scheme.
- Click the configuration item to toggle between Debug and Release.
- Click the destination item in the status bar and choose a device/simulator.
- Use the refresh command after plugging in a new device or changing simulator availability.
Requirements
- macOS with Xcode command line tools installed
xcodebuild available on PATH
- For full device/simulator resolution:
xcrun simctl
xcrun devicectl
Troubleshooting
No workspace found
If you see:
xcode-selector: no .xcworkspace found. Set xcode-selector.workspacePath in settings.
Set xcode-selector.workspacePath to your workspace path in settings.
No destinations found
- Ensure a scheme is selected first.
- Confirm the scheme supports your target platform.
- Run the refresh command after simulator/device changes.
Device identifiers look inconsistent
Different tools can report different IDs for the same physical device. The extension attempts to normalize IDs by matching selected destinations with xcrun output.
Development
npm install
npm run compile
Watch mode:
npm run watch
Then open this folder in VS Code and run the extension in an Extension Development Host (F5).
Packaging
If you use vsce, typical flow:
npm run compile
npx @vscode/vsce package
This produces a .vsix file for local install/testing.