【问题标题】:xcode - building app with command line gives provisioning profile errorxcode - 使用命令行构建应用程序会导致配置文件错误
【发布时间】:2012-11-07 18:50:04
【问题描述】:

我正在尝试从命令行存档一个应用程序,但它给出了以下错误:

Code Sign error: The identity 'iPhone Distribution: XXX' doesn't match any valid, non-expired certificate/private key pair in your keychains

我正在使用以下几行来构建和归档应用程序:

export DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer

xcodebuild -target TestAppLogicTests \
-sdk iphonesimulator \
-configuration Debug \
TEST_AFTER_BUILD=YES \
clean build | /usr/local/bin/ocunit2junit.rb

# tests passed archive app

export DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer

/usr/bin/xcrun xcodebuild -scheme TestApp clean archive \
CODE_SIGN_IDENTITY="iPhone Distribution: XXX"

我确定我的 CODE_SIGN_IDENTITY 是正确的(我已在 .pbxproj 文件中检查过)。我已经尝试重新下载我的分发证书,但也没有用。它在 xCode 本身中运行良好。

有人知道我可以尝试什么吗?

谢谢!

【问题讨论】:

    标签: xcode code-signing ios-provisioning provisioning-profile


    【解决方案1】:

    打开钥匙串。你看到你的开发者(或发行版)证书了吗?

    如果是,您可以单击它打开下拉菜单吗? 在它下面,你有没有看到一个叫做 private key 的文本和别的东西?

    如果您没有看到任何下拉菜单和私钥,您必须:

    • 从钥匙串启动“向权威机构请求证书”
    • 在您的硬盘上导出证书。
    • 将此证书上传到您的 Apple 开发者帐户的配置文件部分(撤销旧证书)
    • 使用更新的证书更新您的配置文件(进入每个文件并检查您的证书)
    • 通过打开和刷新 XCode 下载新的配置文件
    • 关闭 XCode。
    • 使用命令行构建。

    如果这令人困惑,有很多问题可以更详细地解释这一点,例如this one

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-02-20
      • 2012-01-21
      • 1970-01-01
      • 2019-02-24
      • 1970-01-01
      • 2012-01-21
      • 2018-04-25
      • 2011-04-27
      相关资源
      最近更新 更多