感谢Marc B的建议:
⇒ find / -name swift -type f
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift
/Users/myusername/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/Swift_2.3.xctoolchain/usr/bin/swift
/Users/myusername/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift
/usr/bin/swift
对我来说是:
⇒ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift --version
Apple Swift version 2.2 (swiftlang-703.0.18.8 clang-703.0.31)
Target: x86_64-apple-macosx10.9
⇒ /Users/myusername/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/Swift_2.3.xctoolchain/usr/bin/swift --version
Apple Swift version 2.3 (swiftlang-800.10.6 clang-800.0.24.1)
Target: x86_64-apple-macosx10.9
⇒ /Users/myusername/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift --version
Apple Swift version 3.0 (swiftlang-800.0.30 clang-800.0.24)
Target: x86_64-apple-macosx10.9
⇒ /usr/bin/swift --version
Apple Swift version 2.2 (swiftlang-703.0.18.8 clang-703.0.31)
Target: x86_64-apple-macosx10.9
要将 v3 设置为您的 'main' swift,您可以执行以下操作(确保使用 Xcode 8 应用程序的正确路径):
⇒ sudo xcode-select -s /Applications/Xcode-beta.app/Contents/Developer
⇒ xcrun --find swift
/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift
⇒ swift --version
Apple Swift version 3.0 (swiftlang-800.0.30 clang-800.0.24)
Target: x86_64-apple-macosx10.9