macos - 查看使用 productbuild 创建的包内容

标签 macos productbuild

我使用 productbuild 实用程序创建了一个 pkg 文件,我想查看其内容。我该怎么做?

我在 MacOS 10.9.5 下。

最佳答案

您可以使用 pkgutil 将您的包解压缩到临时目录中.

pkgutil --expand pkg-path dir-path

Expand the flat package at pkg-path into a new directory specified by dir-path.

还有一个非常好的第三方工具叫做 Pacifist ,由 CharlesSoft 提供。无需解压即可查看包内容。

更新

pkg 存档(这是一个 xar 存档)中,您可能会遇到以下文件:

  • Bom:Mac OS X Material list (BOM) 文件

The Mac OS X Installer uses a file system "bill of materials" to determine which files to install, remove, or upgrade. A bill of materials, bom, contains all the files within a directory, along with some information about each file. File information includes: the file's UNIX permissions, its owner and group, its size, its time of last modification, and so on. Also included are a checksum of each file and information about hard links. [man bom]

您可以使用lsbom 列出bom 文件的内容命令。并使用 mkbom 创建文件.

  • PackageInfo:XML文档文本

xml 文件包含有关程序包的一般信息。

  • Payload:gzip 压缩数据,来自 Unix

这是一个 gzip 压缩的 cpio 存档。您可以使用 tar 命令将其内容提取到当前目录:

$ tar -xf Payload

或者解压到指定目录dir-path:

$ tar -C dir-path -xf Payload

您可以选择只列出 Payload 存档的内容:

$ tar -tf Payload

您应该能够使用以下方法从 dir-path 重新创建存档:

$ tar --format cpio -czf Payload dir-path

关于macos - 查看使用 productbuild 创建的包内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29941273/

相关文章:

macos - 如何使用productbuild构建具有自定义背景的OS X安装程序包?

c++ - 在Mac上读写USB(HID)中断端点

Java Runtime.exec() 不从命令行发送电子邮件

macos - 您如何在使用 pkgbuild/productbuild 构建的 OS X 安装程序中询问用户问题?

macos - 在使用 productbuild 创建的安装程序中禁用 "Change Install Location..."按钮

macos - 如何禁止在我的 OS X 安装程序包中选择备用卷?

regex - 如何从文本文件中删除所有不包含 `@` 的行?

xcode - 在 Swift 中初始化 NSOpenGLPixelFormat

java - Watij 的 JxBrowser OS X/Java 1.6_64 不兼容?

macos - 使用 Productbuild 对 mac 应用程序进行签名和存档,无需使用 xcode 在 Mac App Store 之外分发应用程序