Mac Developer Library Developer


This manual page is for Mac OS X version 10.9

If you are running a different version of Mac OS X, view the documentation locally:

  • In Terminal, using the man(1) command

Reading manual pages

Manual pages are intended as a quick reference for people who already understand a technology.

  • To learn how the manual is organized or to learn about command syntax, read the manual page for manpages(5).

  • For more information about this technology, look for other documentation in the Apple Developer Library.

  • For general information about writing shell scripts, read Shell Scripting Primer.

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/,  containing
       the  latest  Xcode,  and  /Applications/ containing a developer preview) use xcode-select
       --switch path/to/ to specify the Xcode that you wish  to  use  for  command  line  developer

       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.

       -h, --help
              Prints the usage message.

       -s <path>, --switch <path>
              Sets the active developer directory to the given path, for example /Applications/
              This  command  must be run with superuser permissions (see sudo(8)), and will affect all users
              on the system. To set the path without superuser permissions or only  for  the  current  shell
              session, use the DEVELOPER_DIR environment variable instead (see ENVIRONMENT).

       -p, --print-path
              Prints  the path to the currently selected developer directory. This is useful for inspection,
              but scripts and other tools should use xcrun(1) to locate tool  inside  the  active  developer

       -r, --reset
              Unsets  any  user-specified developer directory, so that the developer directory will be found
              via the default search mechanism. This command must be run  with  superuser  permissions  (see
              sudo(8)), and will affect all users on the system.

       -v, --version
              Prints xcode-select version information.

              Opens  a user interface dialog to request automatic installation of the command line developer

          Overrides the active developer directory. When DEVELOPER_DIR  is  set,  its  value  will  be  used
          instead of the system-wide active developer directory.

          Note that for historical reason, the developer directory is considered to be the Developer content
          directory inside the Xcode application (for  example  /Applications/
          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/
          Select /Applications/ as the active developer directory.

       xcode-select --switch /Applications/
          As  above,  selects  /Applications/ as the active developer directory.
          The Developer content directory is automatically inferred by xcode-select.

          Runs xcodebuild out of the active developer directory.

       /usr/bin/xcrun --find xcodebuild
          Use xcrun to locate xcodebuild inside the active developer directory.

       env DEVELOPER_DIR="/Applications/" /usr/bin/xcodebuild
          Execute xcodebuild using an alternate developer directory.

          Used to find or run arbitrary commands from the active developer directory. See xcrun(1) for  more

       /usr/bin/agvtool  /usr/bin/desdp  /usr/bin/ibtool /usr/bin/ictool /usr/bin/instruments /usr/bin/ipro-filer /usr/bin/iprofiler
       filer /usr/bin/opendiff /usr/bin/sdef /usr/bin/sdp /usr/bin/xcodebuild /usr/bin/xed
          Runs the matching Xcode tool from with the active developer directory.

       /usr/bin/BuildStrings   /usr/bin/CpMac    /usr/bin/DeRez    /usr/bin/GetFileInfo    /usr/bin/MergePef
       /usr/bin/MvMac  /usr/bin/ResMerger  /usr/bin/RezDet  /usr/bin/RezWack  /usr/bin/Rez  /usr/bin/SetFile
       /usr/bin/SplitForks   /usr/bin/UnRezWack   /usr/bin/ar   /usr/bin/as   /usr/bin/asa    /usr/bin/bison
       /usr/bin/c89  /usr/bin/c99  /usr/bin/clang++ /usr/bin/clang /usr/bin/cmpdylib /usr/bin/codesign_allo-cate /usr/bin/codesign_allocate
       cate   /usr/bin/cpp   /usr/bin/ctags   /usr/bin/ctf_insert    /usr/bin/dsymutil    /usr/bin/dwarfdump
       /usr/bin/flex++   /usr/bin/flex   /usr/bin/g++  /usr/bin/gatherheaderdoc  /usr/bin/gcc  /usr/bin/gcov
       /usr/bin/git-cvsserver   /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/mkdep /usr/bin/nasm /usr/bin/ndisasm /usr/bin/nm /usr/bin/nmedit /usr/bin/otool
       /usr/bin/pagestuff  /usr/bin/ranlib  /usr/bin/rebase  /usr/bin/redo_prebinding  /usr/bin/resolveLinks
       /usr/bin/rpcgen   /usr/bin/segedit   /usr/bin/size   /usr/bin/strings   /usr/bin/strip   /usr/bin/svn
       /usr/bin/svnadmin    /usr/bin/svndumpfilter   /usr/bin/svnlook   /usr/bin/svnserve   /usr/bin/svnsync
       /usr/bin/svnversion /usr/bin/unifdef /usr/bin/unifdefall /usr/bin/xml2man /usr/bin/yacc
          Runs the matching BSD tool from with the active developer directory.


       The xcode-select command first appeared in Xcode 3.0.

Mac OS X                                        July 30, 2013                                XCODE-SELECT(1)

Reporting Problems

The way to report a problem with this manual page depends on the type of problem:

Content errors
Report errors in the content of this documentation with the feedback links below.
Bug reports
Report bugs in the functionality of the described tool or API through Bug Reporter.
Formatting problems
Report formatting mistakes in the online version of these pages with the feedback links below.