问题描述
我正在为iOS开发嵌入式框架。为了制作一个通用的胖子(带有模拟器和设备切片),我创建了一个聚集目标,该脚本使用了 xcodebuild
和 lipo
命令来生成它,就像很多人一样。
I'm developing an embbeded framework for iOS. In order to make an universal fat (with simulator and device slices), I created an aggregate target with a script that uses xcodebuild
and lipo
commands to generate it, as many people does.
使用XCode 7.x,我必须添加用户定义的设置,并使用BITCODE_GENERATION_MODE = bitcode进行设置启用它,但是自从上一个XCode 7.3版本以来,该功能已停止工作。
With XCode 7.x I had to add an user-defined settings with BITCODE_GENERATION_MODE=bitcode in order to enable it, but this has stop working since the last XCode 7.3 release.
我已经尝试了在互联网上找到的所有内容,例如添加 OTHER_CFLAGS =-fembed-bitcode
,但是任何事情都像以前一样...
I've tried everything I found in the internet like add OTHER_CFLAGS="-fembed-bitcode"
, but anything works as before...
我已经在构建日志中看到了这一点:
I have seen this in the build log:
无论我做什么,ENABLE_BITCODE始终为否。
ENABLE_BITCODE is always NO, no matter I do.
有人尝试过从XCode 7.3开始使用xcodebuild命令创建一个启用通用位代码的通用胖框架?
Has anybody tried to create an universal fat framework with bitcode enabled using xcodebuild command since XCode 7.3?
推荐答案
我昨天遇到了类似的问题。经过调查后,在任何Xcode目标中的运行脚本构建阶段运行 xcodebuild
时出现的问题似乎与要使用的工具链的明确规范有关。 ,使用ENV变量 TOOLCHAINS
完成。
I ran into a similar issue yesterday. After some investigation, the problem, that appears when running xcodebuild
from a "Run Script" build phase in any Xcode target, seems related with the explicit specification of the toolchain to be used, done with the ENV variable TOOLCHAINS
.
因此,在Apple发布固定版本的Xcode 7.3之前,您可以尝试在脚本的开头添加以下命令:
Therefore, until Apple releases a fixed version of Xcode 7.3, you can try to add the following command at the beginning of your script:
#解决Xcode 7.3的位码生成问题的方法
未设置TOOLCHAINS
这应该是无害的,因为当您从命令行运行xcodebuild时,默认情况下未设置此env变量,并且此解决方法也很好就我而言。
This should be harmless, as this env variable is not set by default when you run xcodebuild from the command line, and this workaround works just fine in my case.
这篇关于xcodebuild 7.3无法启用位码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!