Mac app store productbuild

北城余情 提交于 2019-11-30 19:38:46

From the Apple document you linked: "You should specify a single component, a signature, and (optionally) a product definition file."

Unless you have a specific requirement, you don't need a product definition file. If you need it, the man page of productbuild has a lot of information. It is just a plist dictionary, 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>

I've verified that Xcode doesn't use a product definition file when you share an archived application as package. This is the actual command line:

/usr/bin/productbuild --component <path-to-xcarchive>/Cool.app 
                      /Applications 
                      <tmp-path>/package.pkg 
                      --sign 3rd Party Mac Developer Installer

If you run man productbuild and look for the section PRODUCT DEFINITION PROPERTY LIST which starts with

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)

Lots more information is given, which you should be able to generate with XCode or a text editor. Within XCode just create a new plist and add the key/value pairs according to your requirements and the possible values listed in the man file.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!