Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

xcodebuild 7.3 can't enable bitcode

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.

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.

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 = NO

ENABLE_BITCODE is always NO, no matter I do.

Has anybody tried to create an universal fat framework with bitcode enabled using xcodebuild command since XCode 7.3?

like image 731
Alejandro Jiménez Agudo Avatar asked Mar 23 '16 17:03

Alejandro Jiménez Agudo


1 Answers

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.

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:

# workaround for bitcode generation problem with Xcode 7.3 unset TOOLCHAINS

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.

like image 86
jlj Avatar answered Oct 02 '22 08:10

jlj