概述

在使用jenkins进行iOS打包时遇到的问题,经过查阅资料解决,在此做个简单总结。

jenkins+iOS的配置

详细步骤可参阅夜空繁星-海IOS使用jenkins进行持续集成2

问题总结

Code Sign error: No matching provisioning profile found: Your build settings specify a provisioning profile with the UUID “efe1c26b-5b3f-45d5-ae1f-0cf42f9da974”, however, no such provisioning profile was found.

出现这个问题的原因就是缺少证书和描述文件。

  1. jenkins不会读取当前用户下的keychain中的证书,所以需要把keychain中的证书复制到系统证书下面;
  2. jenkins同样不会读取当前用户下的Provisioning Profiles,需要把当前用户的Provisioning Profiles复制到系统目录下
    sudo cp /Users/xxx/Library/MobileDevice /Library/MobileDevice

[Warning: usage of –preserve-metadata with option “resource-rules” (deprecated in Mac OS X >= 10.10)!
Warning: –resource-rules has been deprecated in Mac OS X >= 10.10!


ResourceRules.plist: cannot read resources

出现这个问题,一般是OS X 10.10以上系统,需要在Custom xcodebuild arguments中添加CODE_SIGN_RESOURCE_RULES_PATH=$(SDKROOT)/ResourceRules.plist
如果Custom xcodebuild arguments中有多个变量,用英文空格分隔开