【问题标题】:Productsigned Mac app not installing in computers that are not mineProductsigned Mac 应用程序未安装在非我的计算机中
【发布时间】:2014-02-23 15:30:11
【问题描述】:

我有一个 Mac 应用程序,我使用终端上的“productsign”命令对其进行了签名

productsign --sign "3rd Party Mac Developer Installer: My company (dasdfjkaj)" InstallerUnsigned.pkg InstallerSigned.pkg

productsign: signing product with identity "3rd Party Mac Developer Installer: My company (dasdfjkaj)" from keychain /Users/me/Library/Keychains/login.keychain
productsign: adding intermediate certificate "Apple Worldwide Developer Relations Certification Authority"
productsign: Wrote signed product archive to InstallerSigned.pkg

然后我运行了评估命令

spctl -a -v --type install  InstallerSigned.pkg
InstallerSigned.pkg: accepted

我也检查了签名

pkgutil --check-signature InstallerSigned.pkg 
Package "InstallerSigned.pkg":
Status: signed by a developer certificate issued by Apple
   Certificate Chain:
    1. 3rd Party Mac Developer Installer: My company (dasdfjkaj)
    2. Apple Worldwide Developer Relations Certification Authority
    3. Apple Root CA

当我从我的机器上运行安装程序时(Gatekeeper 设置为“Mac App Store 和已识别的开发人员”),它运行良好。当我将它部署到我的网站后下载相同的 pkg 时,它也正确安装。

但是...当我在另一台机器上下载 pkg 时,它无法安装。它无法识别我的开发者 ID。当我在故障机器上运行 spctl 命令时,我得到了

spctl -a -v --type install  InstallerSigned.pkg
InstallerSigned.pkg: rejected

有谁知道为什么它在我自己的机器上运行良好,但是当 pkg 在另一台机器上运行时失败?我真的没有主意了:/

编辑: 这就是我得到的时候

spctl --list --type execute
3[Apple System] P0 allow execute
    anchor apple
4[Mac App Store] P0 allow execute
    anchor apple generic and certificate leaf[field.<I removed this>] exists
5[Developer ID] P0 allow execute
    anchor apple generic and certificate 1[field.<I removed this>] exists and certificate leaf[field.<I removed this>] exists
7[GKE] P0 allow execute [(gke)]
    cdhash H"<I removed this>"
10[GKE] P0 allow execute [(gke)]
    cdhash H"<I removed this>"
14[GKE] P0 allow execute [(gke)]
    cdhash H"<I removed this>"
15[GKE] P0 allow execute [(gke)]
    cdhash H"<I removed this>"
18[GKE] P0 allow execute [(gke)]

【问题讨论】:

  • 使用spctl --list --type execute时的输出是什么样的
  • spctl -a -v --type execute InstallerSigned.pkg InstallerSigned.pkg: rejected
  • 我在主帖中添加了spctl --list --type execute 结果。我得到了 868 个 [GKE] 东西

标签: macos installation certificate package osx-gatekeeper


【解决方案1】:

证书很重要

这些是您需要一起用于共同签名的证书:

  • 开发者 ID 安装程序
  • 开发者 ID 应用程序

    • 第 3 方 Mac 开发者安装程序(通常仅用于 AppStore 应用程序)。

如果不提交到 AppStore,您将使用“Developer ID Installer”证书。对于特定的代码签名部分,您需要使用“Developer ID Application”证书。

Apple Developer Codesigning Workflow Guide

【讨论】:

  • 当我访问 Apple 开发者网站时,我在 developer.apple.com/account/mac/certificate/… 下看到的唯一选项是 Apple Push Notification service SSL (Production)Website Push ID Certificate 另外,我的项目是在 Unity3D 中制作的,而不是在 Xcode 中制作的。
  • @Djokovic,如果您没有它们,则需要使用 XCode &gt; Preferences &gt; Accounts 请求它们。由于您不使用 XCode,您可能可以通过开发人员门户进行操作。
  • 对于您的特定场景,重要的是“确保使用您的 Developer ID 安装程序证书对安装程序包进行签名。productsign 命令行实用程序允许您使用您的 Developer ID 应用程序证书对安装程序包进行签名. 虽然这种方法看起来可行,但生成的安装程序存档将在目标 Mac 上失败"
  • 我在XCode &gt; Preferences 下看不到任何“帐户”。另外,开发者门户在哪里? (感谢您这么快回复!)
  • 您使用的是哪个 XCode?在 XCode 5+ 中,它位于 Preferences > Accounts(第二个按钮)下。然后点击底部的+号。
猜你喜欢
  • 1970-01-01
  • 2011-02-19
  • 1970-01-01
  • 1970-01-01
  • 2016-10-06
  • 1970-01-01
  • 2016-06-15
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多