xcpretty / xcode-install

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

Xcode 10.x installation failed due to certificate issue #360

Closed Kesin11 closed 5 years ago

Kesin11 commented 5 years ago

Issue Description

I tried to install Xcode 10.3 with xcversion install 10.3 but it failed. It success to download and after that, output these log and remove Xcode-10.3.app from /Applications. As a result, I could not get Xcode.

/Applications/Xcode-10.3.app: valid on disk
/Applications/Xcode-10.3.app: satisfies its Designated Requirement
%

I found that the problem was caused by Xcode certificate. https://github.com/xcpretty/xcode-install/blob/v2.6.1/lib/xcode/install.rb#L689-L694 I tried to print cert_info with Xcode 10.3 and result is here.

{"bundle_identifier"=>"com.apple.dt.Xcode",
 "authority"=>
  ["Software Signing",
   "Apple Code Signing Certification Authority",
   "Apple Root CA"],
 "team_identifier"=>"not set"}

verify_app_cert expect team_identifier is equal to TEAM_IDENTIFIER = '59GAB85EFG' but actual value is not set in Xcode 10.3.

I also checked other version of Xcode has same problem. In result, only Xcode 11.1 can be installed. (Xcode 11.0 faces other problem.) https://github.com/Kesin11/xcode-install/runs/275918237

Environment

macOS 10.14.6 ruby 2.6.5 xcode-install v2.6.1

rcousens commented 5 years ago

This issue is also affecting all our MacOS build slaves (12) for a Unity game we develop. We just upgraded them all to mojave while this issue started presenting itself halfway through the conversion process. I've ended up modifying the code directly in the gem once installed to just return true on the verify_app_cert method. Would love to see this fixed properly.

nancy-gomez commented 5 years ago

Ya'll you just need to change your date and time back and it works for the installation! https://forums.developer.apple.com/thread/125108

I changed my date to Oct 23 because the cert for version 11.0 supposedly expired on Oct 24

edulpn commented 5 years ago

Hey everyone, I'm setting up two new machines today and trying to install Xcode 10.3 on them, both on same macOS versions 10.14.6, xcversion 2.6.2, ruby 2.4.0. One works perfectly fine and the other is stuck with this issue. I tried to do @nancy-gomez trick with the date but no deal. Any thoughts? When is this fix mentioned above going to be live?