Error: No valid Xcode installation is properly selected.

Clemens Lang cal at
Tue Aug 28 12:30:08 PDT 2012


On Tue, Aug 28, 2012 at 07:14:10PM +0200, Luc Bourhis wrote:
> "install" or "upgrade" prints
> {{{
> Error:
> Error: No valid Xcode installation is properly selected.
> Error: Please use xcode-select to select an Xcode installation:
> Error:     sudo xcode-select -switch /Applications/ # version
> 4.4.1
> Error:
> }}}
> even after issuing that very xcode-select command. Then "port" seem to
> carry on with its business in a successful manner. I am aware of
> #35150 and of the fix that went into 2.1.2 but that is precisely the
> version I run.

the code that prints this is at

Following the code path to this message tells me
 - you have xcode-select installed
 - xcode-select -print-path either fails or the return value doesn't
   satisfy _is_valid_developer_dir
 - the following code correctly finds your Xcode installation, correctly
   determines its version to be 4.4.1 by querying kMDItemVersion using
 - it then tests, whether /Applications/ is
   a valid developer dir (and it apparently isn't, because it doesn't
   print /Applications/ but
   /Applications/, which is the next elseif in the code).

Looking at _is_valid_developer_dir at
tells us
 - the return value of xcode-select -print-path (which fails the test
   when called in line 435) either doesn't exist (unlikely), or doesn't
   have the subdirectories Library and usr.
 - /Applications/ (called from line 468)
   either doesn't exist, or doesn't ahve the subdirectories Library and

So, please
 - tell us what
     xcode-select -print-path
   returns for you
 - whether the directories tested for exist.

Clemens Lang

More information about the macports-users mailing list