"Four different numbers all get called 'the Swift version'. Only one of them is."
Xcode, or Just the Command Line Tools
A Mac can hold two kinds of Apple toolchain. Xcode is the full thing: the Swift compiler, SwiftPM, xcodebuild, every platform SDK (macOS, iOS, watchOS), the simulators, Instruments, and the signing machinery that talks to your developer account. The Command Line Tools are a much smaller install: a compiler, SwiftPM, git, the macOS SDK — and nothing for iOS, no simulators, no xcodebuild archive or upload.
The difference is not academic. A family Mac that only had the Command Line Tools could build a SwiftPM app fine and then failed every swift test with no such module 'XCTest', and on those tools 'Testing' was missing too. The app was not broken. The toolchain simply did not carry the test frameworks. Current Command Line Tools do ship Swift Testing, but never XCTest. That Mac's repositories now keep a small self-test executable for exactly that case, which you will meet in the packages track.
xcode-select -p tells you which one your shell is using. xcrun finds every tool (swift, codesign, simctl, notarytool) inside that selected developer directory, which is why scripts call xcrun simctl instead of a hard-coded path.
Four Numbers That Are Not the Same Number
| Number | What it controls | Where it lives |
|---|---|---|
| Compiler version | Which Swift features and diagnostics exist at all (6.3.3 on this quest's build Mac) | swift --version |
| Language mode | How the compiler interprets your source: Swift 5 or Swift 6 rules, per target | swiftLanguageModes / SWIFT_VERSION |
| SDK version | Which APIs you are allowed to call (26.x with Xcode 26) | xcrun --sdk iphoneos --show-sdk-version |
| Deployment target | The oldest OS you promise to run on (macOS 14 / iOS 17 / watchOS 10 in this family) | platforms: / deploymentTarget |
Mixing these up produces confident nonsense. "We're on Swift 6" can mean a 6.x compiler compiling everything in Swift 5 mode — which is exactly the situation that let a real crash through. A new API from the 26 SDK does not even compile against an iOS 17 deployment target until you guard it with if #available, and that guard is what keeps an iOS 17 device from reaching a symbol it does not have.
Apple Moves the Floor Every Year
Apple ships a new Xcode, SDK and Swift release every autumn and then raises the minimum for uploads. Since April 28, 2026, iOS, iPadOS, tvOS, visionOS and watchOS apps uploaded to App Store Connect must be built with Xcode 26 or later and a 26 SDK. Apple's notice does not list macOS. Your deployment target can stay old; your build toolchain cannot. This quest is pinned to what the family actually ships with: Swift 6.3.3 and Xcode 26.6 on macOS 26. Swift 6.4 and Xcode 27 were announced at WWDC 2026 — when they reach the build Mac, re-check every version-specific claim against the release notes, not against memory.