Taking charge of those xips

Apple adopted the digitally-signed xip format for Xcode downloads a few years ago. It’s basically a signed version of zip archives. Most commonly, you download a xip and double-click. Archive Utility will open the file, verify its signature, and expand its contents.

In its default settings, Archive Utility always expands files to the same folder you download to. With Xcode, this is a big pain as moving the app with its thousands and thousands of tiny subfiles and embedded executables takes forever. Alternatively, moving the xip file from one location on your system to another can be painfully slow.

Fortunately, Archive Utility does allow you to specify where to unpack. Launch the Application using spotlight (or /System/Library/CoreServices/Applications/Archive Utility.app) and open preferences.

Although there’s no “Ask” option for “Save expanded files”, you can select where you want items to be stored using “into” from the pop-up:

Once set, you have to unset it for general use, because the location persists between launches. This is, needless to say, a big pain when you use archives for non-Xcode purposes on a regular basis:

Fortunately, you can unxip more effectively by using the command-line xip utility located in /usr/bin/xip without having to mess with Archive Utility or its preferences:

% xip
Usage: xip [options] --sign <identity> <input-file> [ <input-file> ... ] <output-xip-file>

Usage: xip --expand <input-file>

99.9% of everything you do with xip is that last “Usage” example. Still, as xip doesn’t offer a --help option, if you want to know what those interesting [options] are, you’ll need to read the man page (man xip). I prefer to open man pages in Preview instead of the command line, using this little trick:

man -t xip | open -f -a /System/Applications/Preview.app

Notice two things here:

  • First, the -t flag tells man to use the Groff typesetter (no relation) to format the page to postscript. This presents as a PDF in Preview. (Specifically, it uses /usr/bin/groff -Tps -mandoc -c if that kind of detail intrigues you.)
  • Second, the path for Preview has changed in Catalina to /System/Applications. If you want to do this on Mojave or earlier, adjust the path accordingly.

(Isn’t that a neat way to view man pages?)

While the man page suggests you can sign your own xip archives and provide your own identities, don’t bother. This format is exclusive to Apple, starting  from macOS Sierra. Only xip archives signed by Apple can be expanded in modern macOS releases. (See Tech note TN 2206 for details.)

Since --expand cannot be used with any other arguments, hop over to /Applications, and expand from there:

% cd /Applications/
% time xip --expand /Volumes/Kiku/xips/Xcode_11.2.1.xip 

Adding the time command at the start of the line lets you know how long it took to unxip, which is deeply satisfying to those of pedantic bent like myself. For those playing along, it was

xip: expanded items from "/Volumes/Kiku/xips/Xcode_11.2.1.xip"
1109.625u 275.408s 10:58.85 210.2%	0+0k 0+0io 167pf+0w



  • When you use open -a, you don’t need to specify the path – try open -f -a Preview.app 🙂

  • Hi Erica,
    I follow you from the time of the early iPhone/iPod applications (when jailbreaking was necessary to install them and no Apple support), always good tech, info, practices, programming tips. But this time I really don’t understand the fuss….
    I never experience even a small delay in moving the Xcode app from my download folder to the Applications folder. It is true that both reside in the same disk (an ssd), but even this are composed by thousand files, the task is immediate, so quick I cannot tell how much time it needs.
    Are you moving them between two disks (but then it is a copy by default, not moving).

    Why it takes so long in your case that you feel the need to spend time to work out an alternative?
    The APFS system has made the process even faster, nothing is really moved from my understanding. Only the “address” is changed.

    Have you time to elaborate?

    Cheers, Luca

    • I forgot to mention:

      if you delete from Applications the previous version of Xcode.app and then you move the new one in place is quick. But if instead you replace the previous version with the new one by moving, then it takes quite long, but this because is probably replacing files one by one, not simply changing the address of the entire archive/app.



      • Yes, I download to a different volume. And yes, I’ve learned to not overwrite one expanded version with another! 🙂