Mac应用商店productbuild

时间:2011-11-07 15:44:21

标签: macos installer package mac-app-store productbuild

Apple的document on submitting an app to the Mac App store包含使用命令productbuild的示例,来自/ Developer / usr / bin /。

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

当我在Sample应用程序上运行此命令时,出现错误:

  

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

这个product_definition.plist是什么,应该从哪里来,应该包含什么,以及应该用什么工具来创建这个plist?

2 个答案:

答案 0 :(得分:11)

来自Apple document you linked:"您应指定单个组件,签名,和(可选)产品定义文件。"

除非您有特定要求,否则您不需要产品定义文件。如果需要,productbuild的手册页有很多信息。它只是一个plist字典,like this example

<?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

答案 1 :(得分: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文件中列出的可能值添加键/值对。