Select a given path as the active developer directory

xcode-select

  • Switch between different versions of Xcode and the included developer tools.
    Also used to update the path to Xcode if it is moved after installation.
    More information: <https://developer.apple.com/library/archive/technotes/tn2339/_index.html>.
  • Trick copyright: tl;dr; <https://github.com/tldr-pages/tldr>

xcode-select --switch {{path/to/Xcode.app/Contents/Developer}}

click the source code to copy