【问题标题】:Mac app store productbuildMac 应用商店产品构建
【发布时间】:2011-12-23 17:43:47
【问题描述】:

Apple 的 document on submitting an app to the 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: 错误: 找不到产品定义 plist “product_definition.plist”。

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

【问题讨论】:

  • 注意:证书有效且在钥匙串中。 Release 构建目录中的应用从应用商店下载其测试收据并正常运行。
  • 您的苹果文档链接已损坏...

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


【解决方案1】:

来自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

【讨论】:

    【解决方案2】:

    如果你运行 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 文件中列出的可能值添加键/值对。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-11-03
      • 1970-01-01
      • 2019-08-26
      • 2020-11-26
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多