xcodebuild命令在codesign上失败,但是日志显示正在使用的uuid配置文件不正确

Dav*_*Kap 1 xcode xcodebuild codesign ios

我尝试运行这个:

xcodebuild -scheme "MobileRenderStress.iOS" -destination "generic/platform=iOS" archive -archivePath /Applications/buildAgent/work/builds/MobileRenderStress-iOS.xcarchive
Run Code Online (Sandbox Code Playgroud)

结果如下:

<Many lines of irrelevant log that ends with...>

Signing Identity:     "iPhone Developer: DK (RYQ82Z5555)"
Provisioning Profile: "iOSTeam Provisioning Profile: com.company.*"
                  (0b51596e-46c1-456a-a7bc-911858ad275a)

/usr/bin/codesign --force --sign A72FD8239B6355AE7DECC865F1A13226450F76C --entitlements /Users/builder/Library/Developer/Xcode/DerivedData/Technology-ajtzoltdytdzndgefjzzhzhiufjx/Build/Intermediates/ArchiveIntermediates/MobileRenderStress.iOS/IntermediateBuildFilesPath/MobileRenderStress.iOS.build/Debug-iphoneos/MobileRenderStress.iOS.build/MobileRenderStress.iOS.app.xcent /Users/builder/Library/Developer/Xcode/DerivedData/Technology-ajtzoltdytdzndgefjzzhzhiufjx/Build/Intermediates/ArchiveIntermediates/MobileRenderStress.iOS/InstallationBuildProductsLocation/Applications/MobileRenderStress.iOS.app
/Users/builder/Library/Developer/Xcode/DerivedData/Technology-ajtzoltdytdzndgefjzzhzhiufjx/Build/Intermediates/ArchiveIntermediates/MobileRenderStress.iOS/InstallationBuildProductsLocation/Applications/MobileRenderStress.iOS.app: User interaction is not allowed.
Command /usr/bin/codesign failed with exit code 1

** ARCHIVE FAILED **


The following build commands failed:
    CodeSign /Users/builder/Library/Developer/Xcode/DerivedData/Technology-ajtzoltdytdzndgefjzzhzhiufjx/Build/Intermediates/ArchiveIntermediates/MobileRenderStress.iOS/InstallationBuildProductsLocation/Applications/MobileRenderStress.iOS.app
(1 failure)
Run Code Online (Sandbox Code Playgroud)

我一直在运行xcodebuild命令用于构建和存档(在这个例子中我正在存档)但是我收到了代码签名错误.特别是由于日志确切地指示了它尝试使用(并成功找到)的配置文件ID,但"codesign"的命令行指示了不同的ID.即使我在xcodebuild命令中指定了配置文件,它仍然会尝试在codesign行中使用这个不同的,不存在的ID.

有没有人遇到过这个,知道这个ID甚至来自哪里?我贪图我的整个项目,无处可寻.真的,它有点令人毛骨悚然.

重要说明:当我更新配置文件以获取要更改的ID时,xcodebuild命令STILL会尝试在codesign行使用A72 ID.真的很令人沮丧!

我确实看到日志中指示"不允许用户交互"的部分.虽然这与问题无关,但要知道它在行中使用--force命令应绕过该错误,并且配置文件的签名密钥都是完全许可的,这是此类问题的另一种解决方法.

Sta*_*ner 8

该问题是由"不允许用户交互"引起的.这是因为它需要接受代码签名提示,直到钥匙串解锁后才能从命令行发生.

security unlock-keychain -p YOUR_PASSWORD~/Library/Keychains/login.keychain

您也可以直接在xcode中执行此操作并检查它是否适用于该计算机.