How to extract xip archive using command line?

I was looking for how to extract the XIP archive using the command line without any luck, so I leave my own solution as a bash function here.

I found my inspiration here .

+9
source share
6 answers
 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" } 

First, we verify the signature of the xip file, and then extract its contents using xar . Then we use Jonathan Levin pbzx to properly unpack the pbzx and pbzx output into tar , skipping . to avoid overwriting current working directory permissions.

This does the trick to unzip the Xcode8.xip archives on OS X El Capitan.

+6
source

You can try:

xip -x [path to.xip file]

+4
source

open -W archive.xip will work better, as it will block until the archive completes opening.

+3
source

Use unxip . You can install it using Homebrew:

 brew install thii/unxip/unxip 

To extract the .xip file:

 unxip path/to/.xip 
+1
source

You can simply run:

 open archive.xip 
0
source

On macOS Mojave (not sure about other OS versions), navigate to the directory where you want to deploy the content, and then run xip --expand/path/to/xip.xip . For instance:

 iMac:Applications jeff$ xip --expand /Users/jeff/Downloads/Xcode_11_Beta.xip 
0
source

Source: https://habr.com/ru/post/1259256/


All Articles