xcode-install icon indicating copy to clipboard operation
xcode-install copied to clipboard

Installation from xip archives doesn't work without a GUI session

Open nikolaykasyanov opened this issue 7 years ago • 3 comments

I believe that it's a valuable scenario for CI servers and automated macOS virtual machine provisioning.

The culprit is Archive Utility.app, it just hangs when launched from SSH without an active GUI session. Unfortunately I couldn't find a pure CLI way to unpack a xip archive on macOS without having to download & compile pbxz stream parser source code (seriously, Apple?).

Although there is a Python version of pbxz implementation (that could theoretically be translated to Ruby), I'm not sure about the licensing status thereof.

References:

EDIT: wording, references.

nikolaykasyanov avatar Feb 23 '18 09:02 nikolaykasyanov

Last I remember testing this (not via XcodeInstall but using Archive Utility directly, also launched via SSH with no user logged in) it worked if I specified /System/Library/CoreServices/Applications/Archive Utility.app/Contents/MacOS/Archive Utility <path/to/xip>, and then I'd eventually get my decompressed result in the same directory as the input argument.

I remember seeing errors about the lack of a graphics session at the time, but it still worked. That was probably back in OS X 10.11 El Capitan days. Is that what you tried as well?

timsutton avatar Mar 10 '18 20:03 timsutton

@timsutton I've never tried to do it manually, although I that's exactly what xcode-install does.

nikolaykasyanov avatar Mar 12 '18 09:03 nikolaykasyanov

I am currently experiencing this as well, it seems on Catalina Beta installing xcode via xcversion install automatically tries to launch the archiver utility app but it hangs. When double clicking it or running open ./Library/Caches/XcodeInstall/Xcode_11_Beta_3.xip. Neither of these is ideal, even the open command immediately returns so I would have to continuously poll to find out if my .app file exists but again, not ideal D:

I am also trying to get this to run automatically via ssh from an ansible playbook. I am trying to give xip --expand ./Library/Caches/XcodeInstall/Xcode_11_Beta_3.xip a shot but it says it worked and I don't see my .app in there :'(

Please! Why is the Archiver Utility hanging?? :c

Update:

xip did in fact work I just realized it saved to the current working directory, not the directory of the 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! 🎊💃🎊

nancy-gomez avatar Jul 11 '19 00:07 nancy-gomez