xcpretty / xcode-install

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

xcversion install not installing correct version Xcode #384

Closed H2wk closed 4 years ago

H2wk commented 4 years ago

Hi

Tried to update to Xcode 11.4 last night. Updated xcversion list: Screenshot 2020-04-03 at 09 37 49

Installed xcversion install 11.4 Screenshot 2020-04-03 at 09 37 56

Download was successful, signature passed, and install was successful. Screenshot 2020-04-03 at 09 38 38

Looking a bit more closely you can see the build identifier is for Xcode 11.4 beta 3

On running xcversion list it appears to have gotten confused with versions. Screenshot 2020-04-03 at 09 38 48

Hope someone has some ideas around this.

yoxisem544 commented 4 years ago

having this problem too. Installing 11.4 (11N132i) but never intall 11.4 (11E146) the right version.

Kesin11 commented 4 years ago

This problem comes from installed Xcode binary does not have any information about itself is a prerelease version (ex: beta, RC) or official version.

xcversion list compare between list of "Xcode" and "InstalledXcode". "Xcode" created from fetched Developer portal response.. It have version name (ex: 11.4 beta 3). "InstalledXcode" created from local machine "/Application" and It provides two of versions. ":version" made by "xcodebuild -v" and ":bundle_version: made by Info.plist inside of Xcode app. So we have not any information to match exactly two of Xcode list.

One workaround is creating new version identifier in "InstalledXcode" that made from installed Xcode app name. The path of Xcode 11.4 beta 3 is "/Applications/Xcode-11.4.beta.3.app", so it is possible to determine if it is the beta version or not. Of course, if installed Xcode app is renamed, it will not be able to be correctly identified.

robertwijas commented 4 years ago

Fix has been recently merged to master. #382 Does it mean that it didn't fix the problem?

SzymonMrozek commented 4 years ago

@robertwijas Yes, it seems that this still installs beta instead release version

alejandroivan commented 4 years ago

Looks like using xcversion install 11.4 chooses whatever version first matches 11.4, but xcversion install 11.4beta is invalid. Probably searching for 11.4 exactly and then match if there isn't any exact match should be enough for it to work correctly.