xcodebuild 标志覆盖 pods 项目目标的代码签名

标签 xcode continuous-integration cocoapods code-signing xcodebuild

我在构建(归档)工作区时遇到问题,因为每当我运行
xcodebuild archive -workspace app.xcworkspace/ -scheme app-scheme -configuration Production -derivedDataPath ./build -archivePath ./build/Products/app.xcarchive DEVELOPMENT_TEAM=AAABBBCCCD PROVISIONING_PROFILE_SPECIFIER="prod DistProf" CODE_SIGN_IDENTITY="iPhone Distribution"
我得到
XXX does not support provisioning profiles. XXX does not support provisioning profiles, but provisioning profile YYY has been manually specified. Set the provisioning profile value to "Automatic" in the build settings editor.
对于每个 pod 。
当我省略 DEVELOPMENT_TEAM标记然后我得到
Signing for "myAPP" requires a development team. Select a development team in the build settings editor that matches the selected profile "YYY".
所有的 Pod 都不需要签名。在命令行中指定标志似乎忽略了不同项目的设置。我不能使用自动签名,因为我不是颁发证书的团队成员,我的机器上只有证书和配置文件,因此任何 faSTLane 解决方案都不起作用。此外,我无法在项目中设置一次,因为它来自 3rd 方公司,而且我们无法共享我们的个人资料。
如何将这个项目设置为持续集成链?

最佳答案

我遇到了同样的问题,并在多次尝试错误后找到了一个可行的解决方案。

尽管我在这个 Google 群组 https://groups.google.com/forum/#!topic/cocoapods/q5x653je7MA 上发现了相反的声明,但我无法使用命令行方法来工作。

对我有用的是停止在命令行中指定团队、配置和身份,而是将其移动到 xconfig 文件中。

在使用 Cocoapods 的特殊情况下,它是这样的:

创建 xconfig 文件 .这是通过简单地使用 Xcode 创建一个新的“配置设置”文件来完成的(它位于新文件对话框中的“其他”下)。该文件将为空。

在 xconfig 文件中填写代码签名的值 .这可以通过首先在 xcode 的build设置中设置值然后复制和粘贴来完成。生成的文件如下所示:

#include "Pods/Target Support Files/Pods-xxx/xxx.release.xcconfig"

//:configuration = Release
DEVELOPMENT_TEAM = xxx
//:configuration = Release
PROVISIONING_PROFILE_SPECIFIER = xxx/xxx

替换 xxx为您的项目提供正确的值(value)观。 PROVISIONING_PROFILE_SPECIFIER值(value)是

a combination of the Team ID and profile name (as it is named in the Developer Portal, not necessarily the actual filename)



如此处指定 https://possiblemobile.com/2016/06/code-signing-xcode-8/

注意第一行是包含cocoapods生成的release.xconfig。这个很重要!如果你不这样做并运行 pod update ,你会看到一个警告弹出,要求你这样做,否则什么都不会起作用

为您的项目分配使用 xconfig 文件 .这是通过转到“项目”的“常规”选项卡并滚动到“配置”设置来完成的。然后,您可以从 Release 下的下拉列表中选择新创建的 xconfig 文件

(有关如何使用 xconfig 文件的更多信息可以在这里找到 http://www.jontolof.com/cocoa/using-xcconfig-files-for-you-xcode-project/)

有了所有这些,您可以继续构建存档:
xcodebuild archive \
             -workspace "xxx" \
             -scheme "xxx" \
             -sdk iphoneos \
             -archivePath "xxx"

关于xcodebuild 标志覆盖 pods 项目目标的代码签名,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41447343/

相关文章:

ios - Swift 4 - 如何在 pod 类中导入 AppDelegate

ios - Facebook Cocoapods 集成

ios - 函数 'FBSDK_NOT_DESIGNATED_INITIALIZER' 的隐式声明在 C99 中无效 预期 ')'

ios - Google 登录 CocoaPods 已弃用

ios - Xcode 错误,还是编译错误? "Unable to convert data to string around character"

.net - Cruise Control include.projects 无法识别

javascript - 持续集成期间js的最佳打包策略?

iphone - 有没有更简单的方法来制作这样的东西?

ios - Twitter 趋势 API 1.1 错误 "unrecognized selector sent to instance"

node.js - 如何使用 Jenkinsfile 执行 Node.JS API 测试用例