Search code examples
xcodemacosmacos-high-sierra

How to switch command line tools on MacOS


I installed two commmand line tools on my mac. So I want to switch command line tools. How I can do it?

I tried switch from Xcode preferences > Locations > Command line tools. However, Command line tools beta 1 for Xcode 10 is not appear on this menu.

Xcode 9.4 is installed on my mac.
macOS 10.13.5

  • Xcode 9.4 command line tools (bundled with Xcode9.4, it installed at /Applications/Xcode.app/Contents/Developer)

  • Command line tools beta1 for Xcode 10 (not bundled with Xcode, it installed at /Library/Developer)


Solution

  • Use this command in terminal to switch xcode:

    sudo xcode-select -s /Applications/Xcode-beta.app 
    

    See: https://medium.com/@maximbilan/switch-command-line-tools-to-xcode-beta-2e99c54cb147