xcpretty / xcode-install

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

xcode installation fails on using archive utility #336

Closed salmanasiddiqui closed 5 years ago

salmanasiddiqui commented 5 years ago

When running xcversion install command on machine without GUI service running, the Archive Utility fails with the following error:

_RegisterApplication(), FAILED TO establish the default connection to the WindowServer, _CGSDefaultConnection() is NULL.
2019-05-02 11:26:54.842 Archive Utility[3338:14365] +[NSXPCSharedListener endpointForReply:withListenerName:]: an error occurred while attempting to obtain endpoint for listener 'ClientCallsAuxiliary': Connection interrupted

Alternative way to extract .xip is to use xip -x command.

What I ended up doing is using xcversion install <version> --no-install and then use xip -x Xcode_<version>.xip and that worked.

May be xcode-install should use xip -x instead of archive utility ? if it makes sense I can make a PR should be pretty simple

jpsim commented 5 years ago

This is a great idea, and even running xcversion in a GUI environment, I've been slightly annoyed by Archive Utility visibly launching a new window. 👍

salmanasiddiqui commented 5 years ago

https://github.com/xcpretty/xcode-install/pull/337

created PR with the suggested change

nancy-gomez commented 5 years ago

So I'm seeing that expanding the .xip file is the issue when attempting to install this Xcode version. However, my exception is that instead of receiving an error, I simply have the command hanging. It's happening for the Archive Utility as well as the xip -x :( I see this:

$ xip -x ./Library/Caches/XcodeInstall/Xcode_11_Beta_3.xip
xip: signing certificate was "Software Update" (validation not attempted)

And then nothing! :( Anyone having a similar issue?

Update:

xip did in fact work, I wasn't waiting long enough and realized it saved to the current working directory, not specifically the directory of the xip (unless that's where you ran the xip command from)!

xip --expand ./Library/Caches/XcodeInstall/Xcode_11_Beta_3.xip 👍

For anyone else wondering how to force xcversion not to expand the .xip file for you, just pass the --no-install flag and then you can run the xip command!

Happy coding! 🎊💃🎊