Skip to content

Commit

Permalink
[osx] Fix "'xcodebuild' requires Xcode" error
Browse files Browse the repository at this point in the history
By default, the `xcode-select` developer directory points to
`/Library/Developer/CommandLineTools`, but since it doesn't
get (immediately?) updated to point to the appropriate directory
from within `Xcode.app` once `Xcode` is installed, the following
error will be raised when trying to install anything that require
the `Xcode` CLTs:

 " xcode-select: error: tool 'xcodebuild' requires Xcode, but
   active developer directory '/Library/Developer/CommandLineTools'
   is a command line tools instance. "

This commit fixes the issue described above by making the
`xcode-select` developer directory point to the appropriate
directory from within `Xcode.app` once Xcode is installed.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Fix #13
Ref #13
  • Loading branch information
alrra committed Sep 27, 2015
1 parent a38f339 commit e5977d4
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions os/os_x/installs/install_xcode.sh
Expand Up @@ -13,6 +13,8 @@ main() {
# Prompt user to install the XCode Command Line Tools
xcode-select --install &> /dev/null

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

# Wait until the XCode Command Line Tools are installed
while ! xcode-select -p &> /dev/null; do
sleep 5
Expand All @@ -22,6 +24,15 @@ main() {

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

# Point the `xcode-select` developer directory to
# the appropriate directory from within `Xcode.app`
# https://github.com/alrra/dotfiles/issues/13

sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
print_result $? 'Make "xcode-select" developer directory point to Xcode'

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

# Prompt user to agree to the terms of the Xcode license
# https://github.com/alrra/dotfiles/issues/10

Expand Down

0 comments on commit e5977d4

Please sign in to comment.