9

Apple 的关于向 Mac App Store 提交应用程序的文档包含使用 /Developer/usr/bin/ 中的命令 productbuild 的示例。

productbuild \
--component build/Release/Sample.app /Applications \
--sign "3rd Party Mac Developer Installer: Name1 Name2" \
--product product_definition.plist Sample.pkg

当我在我的示例应用程序上运行此命令时,我收到错误:

productbuild:错误:在“product_definition.plist”中找不到产品定义 plist。

这个product_definition.plist是什么,它应该来自哪里,里面应该是什么,应该使用什么工具来创建这个plist?

4

2 回答 2

11

您链接的 Apple 文档中:“您应该指定单个组件、签名和(可选)产品定义文件。”

除非您有特定要求,否则您不需要产品定义文件。如果你需要它,手册页productbuild有很多信息。它只是一个 plist 字典,就像这个例子

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>gl-renderer</key>
    <string>( 'GL_APPLE_float_pixels' IN extensions )</string>
</dict>
</plist>

我已经验证,当您将归档的应用程序作为包共享时,Xcode 不使用产品定义文件。这是实际的命令行:

/usr/bin/productbuild --component <path-to-xcarchive>/Cool.app 
                      /Applications 
                      <tmp-path>/package.pkg 
                      --sign 3rd Party Mac Developer Installer
于 2011-11-15T10:19:59.160 回答
3

如果您运行 man productbuild 并查找以 PRODUCT DEFINITION PROPERTY LIST 开头的部分

PRODUCT DEFINITION PROPERTY LIST
 When you use productbuild to synthesize a distribution (e.g. with the --component option), you can specify additional parameters and
 requirements in a separate property list file, specified with the --product option. At the top level, this property list is a dictio-
 nary, with the following keys:

 Key                       Description
 os                        Minimum allowable OS versions (array of strings)
 arch                      Supported architectures (array of strings)
 ram                       Minimum required RAM in gigabytes (real)
 bundle                    Specific bundles that must exist on the system (array of dictionaries)
 all-bundles               Are all of the bundles specified required? (Boolean)
 gl-renderer               Required OpenGL capabilities (string)
 cl-device                 Required OpenCL capabilities (string)
 single-graphics-device    Must OpenGL and OpenCL requirements be met by a single device? (Boolean)
 home                      Should installation be allowed in user home directory? (Boolean)

提供了更多信息,您应该能够使用 XCode 或文本编辑器生成这些信息。在 XCode 中,只需创建一个新的 plist 并根据您的要求和 man 文件中列出的可能值添加键/值对。

于 2011-11-12T15:28:07.490 回答