xcode 如何使用命令行提取 xip 存档?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/40414645/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to extract xip archive using command line?
提问by Ninja Inc
采纳答案by Ninja Inc
function unxip()
{
[ -z "" ] && 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 "" ] && echo " not found." && return
[ -f "Content" ] || [ -f "Metadata" ] && echo "Content or Metadata already exists." && return
pkgutil --check-signature "" && xar -xf "" && "$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 pbzxto properly unpack pbzx
chunks and pipe the output to tar
, skipping .
to avoid overwriting current working directory permissions.
我们首先检查xip
文件签名,然后使用xar
. 然后我们使用 Jonathan Levin pbzx正确解包块pbzx
并将输出通过管道传输到tar
,跳过.
以避免覆盖当前工作目录权限。
This does the trick to unpack Xcode8.xip
archives on OS X El Capitan.
这可以Xcode8.xip
在 OS X El Capitan 上解压缩档案。
回答by Geoff Nixon
You could try:
你可以试试:
xip -x [path to .xip file]
xip -x [path to .xip file]
回答by Jeff Kelley
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:
在 macOS Mojave(不确定其他操作系统版本)上,导航到您想要展开内容的目录,然后运行xip --expand /path/to/xip.xip
. 例如:
iMac:Applications jeff$ xip --expand /Users/jeff/Downloads/Xcode_11_Beta.xip
回答by Thi
回答by ablarg
open -W archive.xip
will work better since it will then block until the archive has finished opening.
open -W archive.xip
会工作得更好,因为它会阻塞,直到存档完成打开。
回答by maskeda
You could just run:
你可以运行:
open archive.xip