XcodesOrg / xcodes

The best command-line tool to install and switch between multiple versions of Xcode.
MIT License
3.6k stars 120 forks source link

Install from build identifier #232

Open ChaosCoder opened 1 year ago

ChaosCoder commented 1 year ago

Xcode has build identifiers that identify a version uniquely. When using xcodes list the following Xcode build identifiers, which are rendered in paranthesis (e.g. 14A30) are available:

1.0 (7B85)
1.5 (7K571)
2.2.1 (8G1165)
[…]
13.4 (13F17a)
13.4.1 (13F100)
14.0 Beta (14A5228q)
14.0 Beta 2 (14A5229c)
14.0 Beta 3 (14A5270f)
14.0 Beta 4 (14A5284g)
14.0 Beta 5 (14A5294e)
14.0 Beta 6 (14A5294g)
14.0 (14A309)
14.0.1 (14A400)

This PR adds the possibility to install a version of Xcode by specifying the build identifier, which can easily be copied from most terminals by double clicking the identifier, copying it and then typing xcodes install --build and pasting the identifier:

xcodes install --build 14A400

Out of scope of this PR: I would have liked to match the build identifier without specifying the --build flag, but as xcodes heavily relies on semantic versioning this would have been a much more complex change in the current code base. However, by introducing this purely additive flag, we could leverage this later to do include the build identifier when fuzzy searching the Xcode version.

ChaosCoder commented 1 year ago

I see that the latest caching commits have produced a lot of conflicts with this PR. I would rebase it, if you see, that this PR could be accepted after doing so. So I will wait for your input here.

MattKiazyk commented 1 year ago

@ChaosCoder absolutely would accept this pr for installing via build number. Thanks!