xcpretty / xcode-install

🔽 Install and update your Xcodes
https://fastlane.tools
MIT License
2.59k stars 239 forks source link

xcversion is not listing all installed versions of Xcode #209

Closed samdmarshall closed 7 years ago

samdmarshall commented 7 years ago

I have build machines that have multiple installs of Xcode on them, and when queried through xcversion list these are the results i see:

jenkins-slave03:~ jenkins$ xcversion list
8
8.1 (installed)
8.2
8.2.1 (installed)
8.3 (installed)
8.3.1 (installed)

However, when i check against the spotlight database, the results are different:

jenkins-slave03:~ jenkins$ mdfind "kMDItemCFBundleIdentifier == 'com.apple.dt.Xcode'"
/Applications/Xcode-8.3.2.app
/Applications/Xcode-8.3.app
/Applications/Xcode-8.2.1.app
/Applications/Xcode-8.3.1.app
/Applications/Xcode-8.1.app
/Applications/Xcode-7.3.1.app
/Applications/Xcode-8.app

Is there a reason why the 7.3.1 install seems to be filtered out of this list?

KrauseFx commented 7 years ago

I'm not too familiar, but looking at the docs it seems like xcversion list lists the available Xcode versions to download:

xcversion list --help
Usage:

    $ xcversion list

      List Xcodes available for download.
samdmarshall commented 7 years ago

Since xcversion downloads and installs from the developer portal, is there a reason why 7.3.1 wouldn't be included in that list (given that it is available on the dev portal).

KrauseFx commented 7 years ago

Can you try running xcversion list --all? That should list all previous releases too 👍

KrauseFx commented 7 years ago

This behavior is mentioned in the usage section of the docs https://github.com/KrauseFx/xcode-install#usage

samdmarshall commented 7 years ago

ah-ha, thank you for helping clear that up @KrauseFx!

KrauseFx commented 7 years ago

I totally agree though, that this is confusing, and maybe we should just print a warning at the end of the output, indicating that there is a --all parameter available.

samdmarshall commented 7 years ago

I would suggest that xcversion list shows a union of:

  1. all versions of the current major version
  2. all installed versions

and the --all behavior is kept as-is. i feel the common case of using this for local development or on CI machines would want to have this behavior easily accessible.