tcrun provides a means to locate or invoke Swift development tools from the command-line on Windows, without requiring users to modify Path or take otherwise inconvenient measures to support multiple Swift toolchains.
tcrun automatically discovers Swift toolchain installations through the Windows registry and provides a unified interface for tool execution across different toolchain versions. It simplifies Swift development on Windows by handling toolchain and SDK management transparently.
The SDK defaults to the boot system OS SDK (Windows.sdk), and can be specified by the SDKROOT environment variable or the -sdk option (which takes precedence over SDKROOT).
tcrun [-sdk SDK] -f <tool_name>
tcrun [-sdk SDK] <tool_name> [tool_arguments]
tcrun [-toolchain ID] <tool_name> [tool_arguments]Find tool location: The first usage returns the full path to the specified tool_name.
Execute tool: The second usage executes tool_name with the provided tool_arguments.
Toolchain-specific execution: The third usage executes the tool using a specific toolchain identifier.
| Option | Description |
|---|---|
-f, -find |
Print the full path to the tool |
-r, -run |
Find the tool in the toolchain and execute it (default) |
-sdk SDK |
Specifies which SDK to use (overrides SDKROOT environment variable) |
-toolchain ID |
Use the specified toolchain identifier |
-toolchains |
List all available toolchains |
-show-sdk-path |
Print the path to the SDK |
-show-sdk-platform-path |
Print the path to the SDK platform |
-version |
Print the version of tcrun |
| Variable | Description |
|---|---|
SDKROOT |
Specifies the SDK to use; overridden by the -sdk option |
TOOLCHAINS |
Specifies the default toolchain to use; overridden by the -toolchain option |
Find the Swift compiler:
tcrun -f swiftExecute the Swift compiler:
tcrun swift --versionBuild with a specific SDK:
tcrun -sdk Windows.sdk swift buildList available toolchains:
tcrun -toolchainsUse a specific toolchain:
tcrun -toolchain org.compnerd.dt.toolchain.20250623.0-asserts swift buildShow SDK path:
tcrun -show-sdk-pathShow SDK platform path:
tcrun -show-sdk-platform-path