Exampleįor demonstration, I have created a new project with new Swift 5.5 features. Using swift -version will show a swift version that the terminal is using, but it not necessarily the version of swift that command-line tools see. You should get /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift which point to current active Xcode. You can find the toolchain path by running xcrun -find swift. Apple Swift version 5.4 (swiftlang - 1205.0. In my case, it is Swift 5.4 from Xcode 12.5. You would get the version that ships with your current active Xcode.
![xcode command line tools install from command line xcode command line tools install from command line](https://www.embarcadero.com/starthere/berlin/mobdevsetup/ios/en/XcodePreference.png)
You can check the currently selected toolchain like this. Download the Command Line Tools for Xcode installation file from the official Apple developer website. To use Xcode in the terminal, install Command Line Tools for Xcode. Most Xcode command-line tools use Swift toolchains based on the current active Xcode. Step 2: Install Command Line Tools for Xcode. And that's what you are going to learn in this article. But if you also want to make it work with CI, you want to make your tools, e.g., Fastlane and xcodebuild know about the new toolchain too.
#Xcode command line tools install from command line how to
If you want to prepare your app for new Swift's features, you can test it with your current Xcode version with the method in How to use a pre-release Swift version in Xcode.
![xcode command line tools install from command line xcode command line tools install from command line](https://appdividend.com/wp-content/uploads/2020/05/How-to-Install-Python-Module-Install-Package-using-Pip.png)
![xcode command line tools install from command line xcode command line tools install from command line](https://becomethesolution.com/images/easyblog_articles/2314/b2ap3_thumbnail_mac-terminal-uninstall-or-install-xcode-tools-terminal-commands.jpg)
A Reddit user has said that the latest macOS update has removed the need to reinstall. (Source 1, 2) Now, it seems that this issue might have been addressed in the latest macOS Big Sur 11.3.1 update. The new release of Xcode always ships with the latest stable version of Swift, e.g., Xcode 12.5 shipped with Swift 5.4, but since Swift is open-sourced, it doesn't need to wait for Xcode to release a new version. Basically, users have to run the Xcode-select install command to install the command line tools after every macOS Big Sur incremental update. Sponsor and reach thousands of iOS developers.