I searched around how to extract XIP archive using command line with no luck so I am leaving my own solution, as a bash function, here.
I found my inspiration here.
I searched around how to extract XIP archive using command line with no luck so I am leaving my own solution, as a bash function, here.
I found my inspiration here.
You could try:
xip -x [path to .xip file]
On macOS Mojave (not sure about other OS versions), navigate to the directory into which you’d like to expand the contents, then run xip --expand /path/to/xip.xip. For instance:
iMac:Applications jeff$ xip --expand /Users/jeff/Downloads/Xcode_11_Beta.xip
xip --expand works in 10.12 Sierra & 10.11 El Capitan as well, even though it wasn't added to the man page until macOS 10.14.function unxip()
{
[ -z "$1" ] && echo "usage: unxip /path/to/archive.xip" && return
# http://newosxbook.com/src.jl?tree=listings&file=pbzx.c
PBZX="/usr/local/src/pbzx/pbzx" && [ ! -x "$PBZX" ] && echo "$PBZX not found." && return
[ ! -f "$1" ] && echo "$1 not found." && return
[ -f "Content" ] || [ -f "Metadata" ] && echo "Content or Metadata already exists." && return
pkgutil --check-signature "$1" && xar -xf "$1" && "$PBZX" Content | sudo tar x --strip-components=1
rm "Content" "Metadata"
}
We first check for xip file signature then extract its contents using xar. We then use Jonathan Levin pbzx to properly unpack pbzx chunks and pipe the output to tar, skipping . to avoid overwriting current working directory permissions.
This does the trick to unpack Xcode8.xip archives on OS X El Capitan.
open -W archive.xip from terminal that will launch bomArchiveHelper and unpack the xip in the current directory and will block until the unarchive is complete. I use this to open Xcode.xip via a shell call in Jenkins all the time. The -W flag tells the shell to wait for the application invoked to exit before proceeding.brew install thii/unxip/unxip also unxips correctly Xcode archives, unlike Apple tools. (but it needs compilation of the pbzx tool from source, which needs to also build a custom lib....)Use unxip. You can install it with Homebrew:
brew install thii/unxip/unxip
To extract a .xip file:
unxip path/to/.xip
Expanding items from “Xcode_12.5.1.xip”: 99% for quite a while now. shall I give up? (what's wrong with that xip? no tool to extract it...)brew install thii/unxip/unxip failed when I tried it (macOS Sequoia). Otoh brew install unxip succeeded. Dunno what's up with that.In my case, i used unxip
brew install unxip
Then extract
unxip <Path-To-The-.xip-File>
brew install unxip succeeded where the more length formula stated above failed. macOS Sequoia. Fwiw.On MacOS Monterey 12.7 the following worked for me:
xip --expand ~/Downloads/Xcode_14.3.1.xipxip: signing certificate was "Software Update" (validation not attempted)sudo mv Xcode.app /Applications/Applications/Xcode.app/Contents/MacOS/Xcode