无法列出我的 Developer ID 应用程序身份

Unable to list my Developer ID Application identity

我按照此处的说明生成用于签署我的应用程序的证书:https://help.apple.com/developer-account/#/devbfa00fef7

不幸的是,我无法使用以下命令对我的应用程序进行代码签名:

codesign --sign "Developer ID Application: My company (XXXXXX)" Test.app --deep
Developer ID Application: My company (XXXXXX): no identity found

我尝试使用以下命令列出我的身份但没有成功:

security find-identity

Policy: X.509 Basic
  Matching identities
  1) xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx "Apple Distribution: My Company (XXXXXXXXXX)"
  2) xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx "3rd Party Mac Developer Installer: My Company (XXXXXXXXXX)"
  3) xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx "Apple Development: Martin Delille (XXXXXXXXXX)"
  4) xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx "Apple Distribution: My Company (XXXXXXXXXX)"
  5) xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx "Apple Development: Martin Delille (XXXXXXXXXX)"
  6) xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx "Mac Developer: Martin Delille (XXXXXXXXXX)"
     6 identities found

  Valid identities only
  1) xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx "Apple Distribution: My Company (XXXXXXXXXX)"
  2) xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx "3rd Party Mac Developer Installer: My Company (XXXXXXXXXX)"
  3) xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx "Apple Development: Martin Delille (XXXXXXXXXX)"
  4) xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx "Apple Distribution: My Company (XXXXXXXXXX)"
  5) xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx "Apple Development: Martin Delille (XXXXXXXXXX)"
  6) xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx "Mac Developer: Martin Delille (XXXXXXXXXX)"
     6 valid identities found

如您所见,我的 Developer Id Application 证书位于我的钥匙串中:

当然,证书在钥匙串中,但除非您也有钥匙,否则它不会显示为 "valid identity"。通常,Keychain Access 会在您拥有密钥的任何证书旁边显示一个披露三角形。它在您的示例中不可见。