Xcode won't generate bitcode section

145 Views Asked by At

im using xcode 13.2.1, MacOs Monterey version 12.2 (M1). Im trying to compile my app with bitcode using xcode. I have Bitcode-Enable = yes in both project and target. I checked the build log and I have no warning stating I am using a framework/library that isn't compiled with bitcode so that's not the issue.

I archived the app and I also made sure to check the rebuild with bitcode option. When I run the command otool -l my-cool-app } | grep LLVM it shows nothing (No bitcode section). What am I possibly doing wrong?

1

There are 1 best solutions below

1
Bental Hadar On

forgot to update, apparently Bitcode-Enable = yes is not enough. you need to specify the correct flag to compile the bitcode.

this is the command line I used: xcodebuild BITCODE_GENERATION_MODE=bitcode OTHER_CFLAGS="-fembed-bitcode" -target "${PROJECT_NAME}"