【FAQ】Jenkins上,xcodebuild报错:No matching codesigning identity found

我在编译iOS APP。同样的命令:

xcodebuild -target "${TARGET_NAME}" -configuration "${BUILD_TYPE}" -sdk "${SDK_TYPE}" ONLY_ACTIVE_ARCH=NO build

在机器上执行正常,在jenkins上执行,就说签名匹配错误:

Check dependencies
Code Sign error: No matching codesigning identity found: No codesigning identities (i.e. certificate and private key pairs) matching “iPhone Distribution: xxxx.” were found.

** BUILD FAILED **


The following build commands failed:
	Check dependencies
(1 failure)
Build step 'Execute shell' marked build as failure

查来查去,发现是证书的安装位置问题:

因为jenkins运行在Mac的守护进程模式,只是认为它是一个不同的用户,所以不会有机会获得钥匙圈或提供个人资料作为您登录使用您的凭据,而我的证书是装在“登录”下的,这会导致代码签名有问题。

所以修改如下:

钥匙链中,右键点击在“登录”下的证书,拷贝,粘贴到“系统”里,就好了~

【FAQ】Jenkins上,xcodebuild报错:No matching codesigning identity found_第1张图片


你可能感兴趣的:(Jenkins,iOS)