How to install Xcode Command Line Tools

后端 未结 13 1932
無奈伤痛
無奈伤痛 2020-11-22 01:08

How do I get the command-line build tools installed with the current Xcode/Mac OS X v10.8 (Mountain Lion) or later?

Unlike Xcode there is no installer, it\'s just a

相关标签:
13条回答
  • 2020-11-22 01:24

    If you want to use the version of tools provided in XCode itself you can use xcrun (e.g. xcrun git). From the help at the bottom of the download preference pane:

    note that from within Terminal you can use the XCRUN tool to launch compilers and other tools embedded within the Xcode application. Use the XCODE-SELECT tool to define which version of Xcode is active. Type "man xcrun" from within Terminal to find out more.

    0 讨论(0)
  • 2020-11-22 01:25

    How do I get the command line builds tools installed with Xcode 4.4 / Mac OS X v10.8 (Mountain Lion) or later?

    For OS X 10.9, you simply install Xcode. The Command Line Tools are bundled with Xcode. From Technical Note TN2339, Building from the Command Line with Xcode FAQ:

    Downloading command-line tools is not available in Xcode for OS X 10.9. How can I install them on my machine?

    In OS X 10.9, the Downloads pane of Xcode Preferences does not support downloading command-line tools. Use any of the following methods to install command-line tools on your system:

    If Xcode is installed on your machine, then there is no need to install them. Xcode comes bundled with all your command-line tools. OS X 10.9 includes shims or wrapper executables. These shims, installed in /usr/bin, can map any tool included in /usr/bin to the corresponding one inside Xcode. xcrun is one of such shims, which allows you to find or run any tool inside Xcode from the command line. Use it to invoke any tool within Xcode from the command line. ...

    0 讨论(0)
  • 2020-11-22 01:26

    The "unofficial" links are also available at

    http://developer.apple.com/downloads/

    and 403: Forbidden unless logged in with a qualifying developer account. Free accounts have access to everything except prerelease software and full OS installs. In particular, the command-line tools packages that coincide with the release of Xcode 4.4 (the "July 2012" packages) were posted on July 27, for both Lion and Mountain Lion.

    Unlike log files, deep-linking Web pages, and the Xcode Preferences window, this page also links to lots of other useful downloads for free and paid developers alike, including everything else that has been unbundled from Xcode (audio tools, accessibility tools, etc.), OS X kernel debug builds, and release versions of Xcode back to 1.0.

    0 讨论(0)
  • 2020-11-22 01:28

    try going into Xcode > Preferences... > Downloads and clicking the button with a downward arrow in a circle next to command line tools.

    0 讨论(0)
  • 2020-11-22 01:32

    I recently had to install Xcode command line tools on Mountain Lion over SSH.

    Notice: I imagine this process would work identically for any version of Xcode or OSX. Just make sure you get your paths correct.

    Here's how I did it...

    1. If you don't have a free Apple developer account, register for one

    2. Login to https://developer.apple.com/downloads

    3. Download the "Command Line Tools for Xcode" appropriate for your version of OSX

      For me, that was "Command Line Tools (OS X Mountain Lion) for Xcode - April 2014"

    4. Copy the dmg file to your remote

      In the following command, I'm using scp to securely copy the file from my local computer to the remote named remote

      $ scp ~/Downloads/command_line_tools_for_osx_mountain_lion_april_2014.dmg remote:Downloads/
      
    5. ssh to your remote

      $ ssh remote
      
    6. mount the dmg file on the remote

      Here, I'm using hdiutil to mount the image

      $ hdiutil attach ~/Downloads/command_line_tools_for_osx_mountain_lion_april_2014.dmg
      
    7. install the package contained in the dmg

      Here, installer must be run with sudo because this package needs to be installed on the root file system

      $ cd /Volumes/Command\ Line\ Tools\ \(Mountain\ Lion\)
      $ sudo installer -pkg Command\ Line\ Tools\ \(Mountain\ Lion\).mpkg -target /
      
    8. unmount the dmg file

      $ hdiutil detach /Volumes/Command\ Line\ Tools\ \(Mountain\ Lion\)
      
    9. delete the dmg file from the remote; optional

      I see no purpose keeping it around, but you can if you want.

      $ rm ~/Downloads/command_line_tools_for_osx_mountain_lion_april_2014.dmg
      
    0 讨论(0)
  • 2020-11-22 01:34

    Here are links for Command Line Tools, located at Apple Developer Server. You may need an apple developer (Paid/Premium) account to access them. You can download current (stable and beta) Xcode Tools. (It does not need device verification. Just ensure your macOS and XCode Tool/SDK version while choosing your command line tool)

    Xcode 11

    • Xcode 11-GM Seed
      - (Command Line Tool (Xcode 11-GM Seed) - for macOS 10.14)

    Xcode 10

    • Xcode 10.2.1
      - (Command Line Tool (Xcode 10.2.1) - for macOS 10.14)

    • Xcode 10.2
      - (Command Line Tool (Xcode 10.2) - for macOS 10.14)

    • Xcode 10.1
      - (Command Line Tool (Xcode 10.1) - for macOS 10.14)
      - (Command Line Tool (Xcode 10.1) - for macOS 10.13)

    • Xcode 10
      - (Command Line Tool (Xcode 10) - for macOS 10.14)
      - (Command Line Tool (Xcode 10) - for macOS 10.13)

    Xcode 9

    • Xcode 9.4
      - (Command Line Tool (Xcode 9.4) - for macOS 10.13)

    • Xcode 9.3.1

    • Xcode 9.3
      - (Command Line Tool (Xcode 9.3) - for macOS 10.13)

    • Xcode 9.2
      - (Command Line Tool (Xcode 9.2) - for macOS 10.13)
      - (Command Line Tool (Xcode 9.2) - for macOS 10.12)
    • Xcode 9.1
      - (Command Line Tool (Xcode 9.1) - for macOS 10.13)
      - (Command Line Tool (Xcode 9.1) - for macOS 10.12)
    • Xcode 9.0.1
      - (Command Line Tool (Xcode 9.0.1) - for macOS 10.13)
      - (Command Line Tool (Xcode 9.0.1) - for macOS 10.12)

    • Xcode 9.0
      - (Command Line Tool (Xcode 9) - for macOS 10.12)
      - (Command Line Tool (Xcode 9) - for macOS 10.13)

    Once you've latest command line tool installed in your system, set it from Xcode Menu.

    (Xcode Menu Items) Xcode ▶ Preferences ▶ Location ▶ Command Line Tool ▶ Select appropriate command line tool

    enter image description here

    0 讨论(0)
提交回复
热议问题