从命令行将 .xip 文件解压缩到文件夹中? [英] Extract .xip file into a folder from command line?

查看:36
本文介绍了从命令行将 .xip 文件解压缩到文件夹中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Apple 偶尔会使用专有的 XIP 文件格式,尤其是在分发 Xcode 版本时.它类似于 zip,但已签名,允许在接收系统上进行验证.当一个 XIP 文件被打开(通过双击)时,Archive Utility 会展开它,但前提是数字签名是完整的.

Apple occasionally uses a proprietary XIP file format, particularly when distributing versions of Xcode. It is an analog to zip, but is signed, allowing it to verified on the receiving system. When a XIP file is opened (by double-clicking), Archive Utility will expand it, but only if the digital signature is intact.

有谁知道如何将 XIP 文件从终端命令行解压缩到特定文件夹?如果签名无效,有没有办法解压这种类型的文件?

Does anyone know how to extract a XIP file from the Terminal command line to a specific folder? Is there any way to unarchive this type of file if the signature is invalid?

推荐答案

也许试试:

xip -x [.xip 文件的路径]

这会将存档解压到您当前的工作目录中.

That will unpack the archive into your current working directory.

至于提取到特定目录,没有明确的选项,但 xip -x 将提取到当前工作目录.因此,cding 到您想要提取文件的位置应该可以工作;如果您特别需要自动执行此操作,请编写一个效果如下的脚本:

As for extracting into a specific directory, there is not explicitly an option for this, but xip -x will extract into the current working directory. Therefore, cding to where you would like to extract the file should work; if you specifically need to automate this, a script to the effect of:

#!/bin/sh

xipfile="$(cd $(dirname "$1"); pwd -P)/$(basename "$1")" # a portable "realpath"

cd "$2"
xip -x "$xipfile"

应该按照我的想法去做吗?

Should do the trick I think?

这篇关于从命令行将 .xip 文件解压缩到文件夹中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆