xcpretty / xcode-install

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

xcversion failures with MacOS 10.14.5 on XC 10.2.1 #339

Closed pg07gordon closed 4 years ago

pg07gordon commented 5 years ago

I have started to notice failures on 10.14.5 systems when installing Xcode 10.2.1

It seems to fail ( as in never progress ) with the following error:

2019-05-16 17:07:33.140 Archive Utility[13993:56922] In void modifyShouldRestoreOnRelaunchCounter(int32_t), _LSSetApplicationInformationItem(_kLSPersistenceSuppressRelaunchAtLoginKey) returned error -600
2019-05-16 17:07:40.227 Archive Utility[13993:56919] In -[NSApplication(NSQuietSafeQuit) _updateCanQuitQuietlyAndSafely], _LSSetApplicationInformationItem(NSCanQuitQuietlyAndSafely) returned error -600

I have tried multiple systems with same error. All systems were freshly formatted.

I'm running the command as follows: xcversion install --url=file:///${local_install_dir}/${__xc_xip} ${__xc_ver}

Thank you in advance!

v-anshie commented 5 years ago

Not sure if this is related but 10.14.5 release has a new security feature that "Kernel extensions signed after April 7, 2019 must be notarized in order to load on macOS 10.14.5. (50016570)"

"The system fails to register tickets stapled to installer packages not scanned by Gatekeeper, which causes newly installed kernel extensions to fail to load if Internet access isn’t available. This can occur if a user launches installation from a local folder or an enterprise uses automated tools to deploy an installer. This issue doesn’t affect stapled disk images, apps, or kext bundles. (50205533)"

jazaval commented 5 years ago

I think this related to #336. @pg07gordon can you try using the latest master to see if this resolves your issue? The changes haven’t been released as a gem yet.

pg07gordon commented 5 years ago

It failed, or I failed... :(

Here is the Error

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
%

/Applications/Xcode-10.2.1.app: accepted
source=Apple System

/Library/Ruby/Gems/2.3.0/gems/xcode-install-2.5.0/lib/xcode/install.rb:689:in `verify_app_cert': uninitialized constant Fastlane::Actions::VerifyBuildAction (NameError)
        from /Library/Ruby/Gems/2.3.0/gems/xcode-install-2.5.0/lib/xcode/install.rb:665:in `verify_integrity'
        from /Library/Ruby/Gems/2.3.0/gems/xcode-install-2.5.0/lib/xcode/install.rb:255:in `install_dmg'
        from /Library/Ruby/Gems/2.3.0/gems/xcode-install-2.5.0/lib/xcode/install.rb:281:in `install_version'
        from /Library/Ruby/Gems/2.3.0/gems/xcode-install-2.5.0/lib/xcode/install/install.rb:50:in `run'
        from /Library/Ruby/Gems/2.3.0/gems/claide-1.0.2/lib/claide/command.rb:334:in `run'
        from /Library/Ruby/Gems/2.3.0/gems/xcode-install-2.5.0/bin/xcversion:12:in `<top (required)>'
        from /usr/local/bin/xcversion:22:in `load'
        from /usr/local/bin/xcversion:22:in `<main>'

Here is what i did

sudo gem uninstall xcode-install
git clone -b "salmanasiddiqui-patch-1" https://github.com/salmanasiddiqui/xcode-install.git
export LANG="en_US.UTF-8"
export LC_ALL="en_US.UTF-8""
sudo gem install rubocop
cd xcode-install
rake build
sudo gem install pkg/xcode-install-2.5.0.gem
sudo xcversion install --url=file:///Bootstrap/initial/Xcode_10.2.1.xip 10.2.1

xcversion installed shows that 10.2.1 (/Applications/Xcode-10.2.1.app) is installed... However trying to use it requires you to accept the license agreement and install the additional components...

jazaval commented 5 years ago

@pg07gordon Can you try again using master? #338 should have resolved that issue.

pg07gordon commented 5 years ago

Yes Master seems to work!

Thank you

Q: When would this be propagated to the default gem installer library?

jazaval commented 5 years ago

Not sure, usually I've seen @KrauseFx do the gem release. @segiddins any chance this release will be done soon? My team and I would love to have this ready to test new Xcode betas on 10.14.5 and potential 10.15 betas on Monday. More than happy to do any other functional testing you need - I've tried using master to install Xcode in a few scenarios already.

segiddins commented 5 years ago

I need to double check if I have push access on RubyGems.org. If I do, I can look into doing a release sometime in the coming week

Nezz commented 5 years ago

I received the following error when running xcversion install 10.2 on macOS 10.14.5:

%No Xcode.app(or Xcode-beta.app) found in XIP. Please remove /Users/administrator/Library/Caches/XcodeInstall/Xcode_10.2.xip if you suspect a corrupted download or run xcversion update to see if the version you tried to install has been pulled by Apple. If none of this is true, please open a new GH issue.

Xcode.app ended up in the Downloads folder and the license agreement wasn't accepted.

I was using xcode-install-2.5.0.

keyurp1987 commented 5 years ago

Same as @Nezz Xcode gets downloaded under Downloads directory.

KrauseFx commented 5 years ago

@segiddins I just added you to the xcode-install gem :+1:

Nezz commented 5 years ago

Any news about this?

dpwolfe commented 5 years ago

This happens for me on macOS 10.15 Beta 1 and Beta 2. Here's my workaround for an attended installation:

  1. Wait until the Xcode download completes and the terminal session appears to be hung. The Archive Utility application will also open.
  2. Open up a second terminal session and run:
    # replace *.xip with the full filename if your cache has multiple *.xip files
    (cd ~/Library/Caches/XcodeInstall; xip --expand ~/Library/Caches/XcodeInstall/*.xip)
  3. If installing the Xcode 11 Beta, fixup the Xcode 11 Beta as referenced in #340 by running this:
    (cd ~/Library/Caches/XcodeInstall; find *.app -type l ! -exec test -e {} \; -delete)
  4. Quit the Archive Utility application.
  5. Return to the first terminal session and enter your password to continue.

If anything went wrong, run xcversion cleanup before trying again.

Edit: Switched to using xip and added the Xcode 11 Beta workaround from #340.

dmarjanovic commented 5 years ago

Still the same error for Xcode 10.2.1 with xcversion 2.5.0 on Mojave 10.4.5. Would be great to see xcversion bump. Thanks! 👍 /cc @segiddins

dpwolfe commented 5 years ago

Following up to my comment from a couple days ago...

The "hanging" behavior that I found and was able nudge past with the steps I provided seems to be due to a difference in how this issue manifests on Catalina 10.15. I had a user install on Mojave 10.14.5 and my steps weren't helpful there. I'm not sure what if any error occurred, but the Xcode-beta.app was sitting in ~/Downloads, maybe because we were using the workaround domain_name-0.5.99999999.gem version of the gem as this was a brand new MacBook.

I ended up completing the install manually from there, moving it to /Applications as Xcode-11.0.app, creating an alias for it next to it named Xcode.app and running xcversion select 11.0 so a proper xcode-select was done. Have not encountered any side effects from doing that yet.

dpwolfe commented 5 years ago

🤦🏻‍♂️We probably avoided the errors others encountered because we disabled System Integrity Protection on this machine earlier. Obviously, that's not an acceptable workaround step unless you need to do that for other reasons.

Looking forward to the next release.🤞🏻

MadsBogeskov commented 4 years ago

I also have a problem where I can't install Xcode 10.2.1 on macOS 10.14.5. I works if I install from master. Is there any progress on getting a new release made?

segiddins commented 4 years ago

Released 2.6.0