As Xcode 8 beta is available to download, I see it's distributed with a .xip
extension, Xcode_8_beta.xip
.
What is the .xip format? What's the difference between previous .dmg format?
Ask Different is a question and answer site for power users of Apple hardware and software. It only takes a minute to sign up.
Sign up to join this communityAccording to the xip
manual page:
A XIP file is an analog to zip(1), but allows for a digital signature to be applied and verified on the receiving system, before the archive is expanded. When a XIP file is opened (by double-clicking), Archive Utility will automatically expand it (but only if the digital signature is intact).
Essentially, an .xip
file is just a .zip
with a signature to verify that the file has not changed since its creator saved it. This protects from both damage from a disk error and from a third-party tampering with the file.
The .xip
file format contains an archive (xar
containing a gzip
archive and metadata) and a signature of the archive.
To decode an .xip
file, use the following commands:
pkgutil --check-signature <xip-file>
xar -xf <xip-file>
tar -zxvf <xar-file>
See the following links where developers discuss this format and its implications:
xip
support for signed, compressed, application updatesApple has since removed xip
from public use. The format has been reserved for Apple's exclusive use in the future, see TN2206:
Important: Starting with macOS Sierra, only XIP archives signed by Apple will be expanded. Developers who have been using XIP archives will need to move to using signed installer packages or disk images.
xip
can be expanded, the files will be in the same folder as the original. According to @AntonTropashko it is likely no files will be produced.
Oct 22, 2016 at 13:15
Metadata
file indicates the compression used for the raw data. Given Apple have re-appropriated the format for private use, they are able to change it without public documentation.
Jul 15, 2017 at 12:44
To my knowledge xip is a xar derivative using gzip compression, with a toc header xml containing checksum, timestamp, certificates, user id/name, creation/modification/access date&time etc.
The Unarchiver and command line (xar, tar) utilities didn't work for me on MacOS 10.12.6. What did work was right clicking on the .xip file and select "Archive Utility", it was able to expand the .xip file successfully.
For future reference, the shell command
xip --expand /path/to/Xcode_x.y.xip
also works, and extracts Xcode into the shell's current directory, so cd /Applications
(or wherever) first.
I'd also strongly recommend removing or or renaming any existing copies of Xcode.app (or Xcode-beta.app) from the target location before using this command†.
As far as I know, this has worked as long as Apple has been distributing Xcode in .xip format, and it worked just now on 10.15.6 to expand Xcode_11.7.xip downloaded from Apple's developer site.
† While I haven't personally tested overwriting with xip
, if similar command-line tools are any indication, it could potentially leave a mess if used to overwrite an existing directory with the same name, leaving behind existing files that don't exist in the archive being extracted, or worse.