XCODE-SELECT(1) | BSD General Commands Manual | XCODE-SELECT(1) |
xcode-select - Manages the active developer directory for Xcode and BSD tools.
xcode-select [-h|--help] [-s|--switch <path>] [-p|--print-path] [-v|--version]
xcode-select controls the location of the developer directory used by xcrun(1), xcodebuild(1), cc(1), and other Xcode and BSD development tools. This also controls the locations that are searched for by man(1) for developer tool manpages.
This allows you to easily switch between different versions of the Xcode tools and can be used to update the path to the Xcode if it is moved after installation.
When multiple Xcode applications are installed on a system (e.g. /Applications/Xcode.app, containing the latest Xcode, and /Applications/Xcode-beta.app containing a beta) use xcode-select --switch path/to/Xcode.app to specify the Xcode that you wish to use for command line developer tools.
After setting a developer directory, all of the xcode-select provided developer tool shims (see FILES) will automatically invoke the version of the tool inside the selected developer directory. Your own scripts, makefiles, and other tools can also use xcrun(1) to easily lookup tools inside the active developer directory, making it easy to switch them between different versions of the Xcode tools and allowing them to function properly on systems where the Xcode application has been installed to a non-default location.
DEVELOPER_DIR
Note that for historical reason, the developer directory is considered to be the Developer content directory inside the Xcode application (for example /Applications/Xcode.app/Contents/Developer). You can set the environment variable to either the actual Developer contents directory, or the Xcode application directory -- the xcode-select provided shims will automatically convert the environment variable into the full Developer content path.
xcode-select --switch /Applications/Xcode.app/Contents/Developer
xcode-select --switch /Applications/Xcode.app
/usr/bin/xcodebuild
/usr/bin/xcrun --find xcodebuild
env DEVELOPER_DIR="/Applications/Xcode-beta.app" /usr/bin/xcodebuild
/usr/bin/xcrun
/usr/bin/actool /usr/bin/agvtool /usr/bin/desdp /usr/bin/genstrings /usr/bin/ibtool /usr/bin/ictool /usr/bin/opendiff /usr/bin/pip3 /usr/bin/python3 /usr/bin/sdef /usr/bin/sdp /usr/bin/stapler /usr/bin/xcodebuild /usr/bin/xcscontrol /usr/bin/xcsdiagnose /usr/bin/xctrace /usr/bin/xed
/usr/bin/DeRez /usr/bin/GetFileInfo /usr/bin/ResMerger /usr/bin/Rez /usr/bin/SetFile /usr/bin/SplitForks /usr/bin/ar /usr/bin/as /usr/bin/asa /usr/bin/bm4 /usr/bin/bison /usr/bin/c89 /usr/bin/c99 /usr/bin/clang++ /usr/bin/clang /usr/bin/clangd /usr/bin/cmpdylib /usr/bin/codesign_allocate /usr/bin/cpp /usr/bin/ctags /usr/bin/ctf_insert /usr/bin/dsymutil /usr/bin/dwarfdump /usr/bin/dyld_info /usr/bin/flex++ /usr/bin/flex /usr/bin/g++ /usr/bin/gatherheaderdoc /usr/bin/gcc /usr/bin/gcov /usr/bin/git-receive-pack /usr/bin/git-shell /usr/bin/git-upload-archive /usr/bin/git-upload-pack /usr/bin/git /usr/bin/gm4 /usr/bin/gnumake /usr/bin/gperf /usr/bin/hdxml2manxml /usr/bin/headerdoc2html /usr/bin/indent /usr/bin/install_name_tool /usr/bin/ld /usr/bin/lex /usr/bin/libtool /usr/bin/lipo /usr/bin/lldb /usr/bin/lorder /usr/bin/m4 /usr/bin/make /usr/bin/mig /usr/bin/nm /usr/bin/nmedit /usr/bin/objdump /usr/bin/otool /usr/bin/pagestuff /usr/bin/ranlib /usr/bin/resolveLinks /usr/bin/rpcgen /usr/bin/segedit /usr/bin/size /usr/bin/strings /usr/bin/strip /usr/bin/swift /usr/bin/swiftc /usr/bin/unifdef /usr/bin/unifdefall /usr/bin/vtool /usr/bin/xml2man /usr/bin/yacc
xcrun(1), xcodebuild(1)
The xcode-select command first appeared in Xcode 3.0.
June 24, 2019 | Mac OS X |