XCode 脚本打包签名冲突

内网的Jenkins CI 上用脚本打包iOS,不能联外网,所以在打包命令中用Manual的方式指定CODE SIGNPROVISIONING PROFILE

xcodebuild archive \
-project ${projectName}.xcodeproj \
-scheme ${projectName} \
-configuration ${configuration} \
-archivePath ../${projectName}.xcarchive \
-sdk iphoneos \
DEVELOPMENT_TEAM=${developmentTeam} \
CODE_SIGN_IDENTITY="iPhone Distribution: xxx" \
PROVISIONING_PROFILE_SPECIFIER="xxx"

有个依赖的子工程QBImagePickerframework方式引入,默认是自动签名的,而且属于node_modules下的package,无法更改工程设置。

CI 报错QBImagePicker与主工程签名冲突

=== BUILD TARGET QBImagePicker OF PROJECT QBImagePicker WITH THE DEFAULT CONFIGURATION (Release) ===

Check dependencies
Code Signing Error: QBImagePicker has conflicting provisioning settings. 
QBImagePicker is automatically signed, but code signing identity iPhone Distribution: xxxx. has been manually specified. 
Set the code signing identity value to "iPhone Developer" in the build settings editor, or switch to manual signing in the project editor.

** ARCHIVE FAILED **

子工程QBImagePicker需要code sign吗?应该怎么解决这问题?

阅读 6.5k
2 个回答

自问自答吧。。

framework 不能用Manual的方式签名,只能用 Auto Sign,所以 xcodebuild 命令中需要指定 CODE_SIGN_IDENTITY="iPhone Developer" 代表Auto Sign,不能指定PROVISIONING_PROFILE_SPECIFIER

xcodebuild archive \
-project ${projectName}.xcodeproj \
-scheme ${projectName} \
-configuration ${configuration} \
-archivePath ../${projectName}.xcarchive \
-sdk iphoneos \
DEVELOPMENT_TEAM=${developmentTeam} \
CODE_SIGN_IDENTITY="iPhone Developer"

有用
Jenkins自动打包出错,我猜测CODE_SIGN_IDENTITY 的value 代表 手动或者自动
CODE_SIGN_IDENTITY = "iPhone Developer"; 自动打包
CODE_SIGN_IDENTITY = "iPhone Distribution: XXX Co., Ltd."; 手动打包
记录一下,留给有缘人

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题