Utilities for Apple MacOS
This tutorial describes the installation and useage of Apple’s XCode set of utilities for developers.
To build Python on a machine requires a GCC compiler. One comes with command-line tools installed with Apple’s XCode IDE. Newer versions also installs a Git client.
“Xcode includes everything developers need to create great applications for Mac, iPhone, iPad, Apple TV, and Apple Watch. Xcode provides developers a unified workflow for user interface design, coding, testing, and debugging. The Xcode IDE combined with the Swift programming language make developing apps easier and more fun than ever
Get the installation location in a Terminal window:
It used to be that one can enter a command:
The response on my Sierra machine is:
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
So below is the “Software Update” approach:
Use an internet browser to https://developer.apple.com/xcode
Provide your Apple ID and password. Get one if you don’t already have one.
Go through Apple’s location verification if prompted.
Click the blue “Download” and provide your Apple ID. You’ll need to establish an Apple ID.
Select the version to download:
File Date Download Unpacked XCode_9.0 2017-09-19 . ? GB ? GB XCode_8.3.2. 2017- . ? GB ? GB XCode_8.2.1 8C1002 2016-12-19 ? GB ? GB XCode_8_beta_2.xip 2016-07-05 5.9 GB 12.32 GB XCode_7.31 2016-05-03 3.8 GB ? XCode_4.1 2014- 2.9 GB ? XCode_3.2.4 2014- 2.? GB ?
NOTE: These are massive files that may take a while to download if you don’t have a fast internet connection.
CAUTION: Even more important, make sure that your machine will have enough free space available.
Open App Store. Click Open.
Remember to delete the installer after you’re done, then
Confirm the version installed.
Xcode 8.2.1 Build version 8C1002
The should match up with the Build Number on the Apple web page.
Alternately, for a more precise version number and other info (Mavericks and up):
pkgutil --pkg-info=com.apple.pkg.CLTools_Executables | grep version
A sample response:
NOTE: Version 9 is available.
This is a specific version of:
pkgutil --pkgs | grep -i tools
The response for 8.3.2:
com.apple.pkg.CLTools_Executables com.apple.pkg.CLTools_SDK_OSX1012 com.microsoft.package.Proofing_Tools
The response earlier:
package-id: com.apple.pkg.CLTools_Executables version: 18.104.22.168.1.1480973914 volume: / location: / install-time: 1484969093 groups: com.apple.FindSystemFiles.pkg-group
Get the version of the GCC (C compiler) installed:
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 Apple LLVM version 8.1.0 (clang-802.0.42) Target: x86_64-apple-darwin16.7.0 Thread model: posix InstalledDir: /Library/Developer/CommandLineTools/usr/bin
XCode is used to develop iOS mobile apps using Swift. So let’s see:
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance