Unity iOS打包持续集成若干问题整理(脚本自动化打包ipa)

由于Unity通过命令行导出的包很多设置不能手动修改,所以需要做一系列的操作去修改xcode的配置,命令行修改只作用于命令行,并不影响原Unity导出xcode工程。以下解决方案均在命令行中编译xcode时添加执行

1、Architecture不支持armv7

问题原因:一般导出的xcode工程支持armv7以及arm64,如果代码需要不支持armv7则修改修改buildsettings里的Architecture配置删除armv7,命令行中可以指定支持执行的架构。

 -arch ARCH                          build each target for the architecture ARCH; this will override architectures defined in the project

问题解决:使用-arch ARCH 参数指定执行架构,如:-arch arm64

2、证书错误(1):

error: Signing for "XXXXXXX" requires a development team. Select a development team in the project editor. (in target 'XXXXXXX')

问题原因:unity导出工程默认证书是Automatic自动获取,如果xcode未配置则会提示该错误,如果需要手动配置证书则需要指定。(详细见参考文献2)

问题解决:使用DEVELOPMENT_TEAM 参数指定执行架构,DEVELOPMENT_TEAM具体可以查mobileprovision文件,命令如下:DEVELOPMENT_TEAM=XXXXXXXX

3、证书错误(2):

error: XXXXXX has conflicting provisioning settings. XXXXXX is automatically signed, but provisioning profile XXXXXX has been manually specified. Set the provisioning profile value to "XXXXXX" in the build settings editor, or switch to manual signing in the project editor. (in target 'XXXXXX')

问题原因:同上,原因是unity导出工程默认证书是Automatic自动获取,这里通过命令指定为手动配置即可。

问题解决:命令如下:CODE_SIGN_STYLE=Manual

4、编译错误:

ld: could not reparse object file in bitcode bundle: 'Invalid bitcode version (Producer: '1001.0.46.3.0_0' Reader: '1000.11.45.5_0')', using libLTO version 'LLVM version 10.0.0, (clang-1000.11.45.5)' for architecture arm64
clang: error
: linker command failed with exit code 1 (use -v to see invocation)

问题原因:该问题原因是代码不支持bitcode,把bitcode关闭即可,注意导出时bitcode设置在编译时并不起作用。

问题解决:命令如下:ENABLE_BITCODE=No

 

参考文献:

1、https://help.apple.com/xcode/mac/current/#/itcaec37c2a6

2、https://issues.jenkins-ci.org/browse/JENKINS-38777

3、https://www.jianshu.com/p/4f4d16326152?nomobile=yes

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值