xcpretty / xcode-install

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

XCode 12.0.1 not being marked as installed #410

Closed mh-bmckee closed 3 years ago

mh-bmckee commented 3 years ago

Hi.

I installed XCode 12.0.1 through xcversion and it reported success. However when I run xcversion installed, it does not appear in the list of installed versions. Any ideas?

Thanks.

$ xcversion --version 2.6.6

$ xcversion install 12.0.1 /Applications/Xcode-12.0.1.app: valid on disk /Applications/Xcode-12.0.1.app: satisfies its Designated Requirement

[22:42:42]: Verifying your Xcode installation at path '/Applications/Xcode-12.0.1.app'... [22:42:42]: Verifying Xcode was signed by Apple Inc. [22:42:42]: $ codesign --display --verbose=4 /Applications/Xcode-12.0.1.app [22:42:46]: ▸ Executable=/Applications/Xcode-12.0.1.app/Contents/MacOS/Xcode [22:42:46]: ▸ Identifier=com.apple.dt.Xcode [22:42:46]: ▸ Format=app bundle with Mach-O universal (x86_64 arm64) [22:42:46]: ▸ CodeDirectory v=20200 size=722 flags=0x2000(library-validation) hashes=15+5 location=embedded [22:42:46]: ▸ VersionPlatform=1 [22:42:46]: ▸ VersionMin=659200 [22:42:46]: ▸ VersionSDK=720896 [22:42:46]: ▸ Hash type=sha256 size=32 [22:42:46]: ▸ CandidateCDHash sha256=980b20937c637f7254d8a41aa5c8995c49a07ba5 [22:42:46]: ▸ CandidateCDHashFull sha256=980b20937c637f7254d8a41aa5c8995c49a07ba5fedd642999fb0808af445e0d [22:42:46]: ▸ Hash choices=sha256 [22:42:46]: ▸ CMSDigest=980b20937c637f7254d8a41aa5c8995c49a07ba5fedd642999fb0808af445e0d [22:42:46]: ▸ CMSDigestType=2 [22:42:46]: ▸ Page size=4096 [22:42:46]: ▸ CDHash=980b20937c637f7254d8a41aa5c8995c49a07ba5 [22:42:46]: ▸ Signature size=4547 [22:42:46]: ▸ Authority=Software Signing [22:42:46]: ▸ Authority=Apple Code Signing Certification Authority [22:42:46]: ▸ Authority=Apple Root CA [22:42:46]: ▸ Info.plist entries=44 [22:42:46]: ▸ TeamIdentifier=59GAB85EFG [22:42:46]: ▸ Sealed Resources version=2 rules=13 files=441067 [22:42:46]: ▸ Internal requirements count=1 size=68 [22:42:47]: Successfully verified the code signature ✅ [22:42:47]: Verifying Xcode using GateKeeper... [22:42:47]: This will take up to a few minutes, now is a great time to go for a coffee ☕... [22:42:47]: $ /usr/sbin/spctl --assess --verbose /Applications/Xcode-12.0.1.app [22:44:51]: ▸ /Applications/Xcode-12.0.1.app: accepted [22:44:51]: ▸ source=Apple System [22:44:51]: Successfully verified Xcode installation at path '/Applications/Xcode-12.0.1.app' 🎧 Xcode 12.0.1 Build version 12A7300

$ xcversion installed 11.0 (/Applications/Xcode-11.app)
11.3.1 (/Applications/Xcode-11.3.1.app)

pronebird commented 3 years ago

Even better:

$ xcversion list
[redacted]
12.0.1 (installed)
12 for macOS Universal Apps beta
12 (installed)
12 beta 5
12 beta 4
12 beta 6
12 beta 2
12 for macOS Universal Apps beta 2
12 beta 3
12.2 beta 2
12.2 beta
$ xcversion uninstall '12'     
[!] Version 12 is not installed.

Then:

$ xcversion installed
12.0    (/Applications/Xcode-12.app)    
12.0.1  (/Applications/Xcode-12.0.1.app)

GUH so it seems that it's 12.0 and not 12!, then xcversion uninstall '12.0' works.

mh-bmckee commented 3 years ago

I figured out the issue that I had. The Spotlight indexes were not updating correctly on the build server. Using command + space on the build machine and searching for 12.0.1 did not return any results.

I had to run the following commands to update the Spotlight indexes to fix the issue: sudo mdutil -a -i off

and then:

sudo mdutil -a -i on