$ xcode-select --print-path /Applications/Xcode.app/Contents/Developer # The nightly toolchain is 6.0-dev $ export TOOLCHAINS = org.swift.59202403031a $ swift --version Apple Swift version 6.0-dev ( LLVM 0c7823cab15dec9, Swift 0cc05909334c6f7 ) SwiftPM also respects the TOOLCHAINS variable, and it has a --toolchains parameter as well, but this one expects the path to the toolchain, not its bundle ID. swift , xcrun , and xcodebuild silently ignore the toolchain setting and use the default Swift toolchain (set via xcode-select ).