Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check if a framework is Bitcode supported for Xcode7

From Xcode 7 it became one of the common problem that third party frameworks should support Bitcode. We can also disable the BITCODE by setting ENABLE_BITCODE to NO in Build settings. But i do not want to turn it off, instead i want to convert all my frameworks to BITCODE compatible.

So how to check if a framework is BITCODE compatible apart from compiling the framework in Xcode. Sometimes Xcode give error for BITCODE compatibility for one framework leaving the others even though they don't have BITCODE support.

Is there any tool/command line check?

like image 653
ipraba Avatar asked Sep 27 '15 13:09

ipraba


People also ask

What is Bitcode support?

Bitcode is an Apple technology that enables you to recompile your app to reduce its size. The recompilation happens when you upload your app to App Store Connect or export it for Ad Hoc, Development, or Enterprise distribution.

Is Bitcode required?

For iOS apps, bitcode is the default, but optional. If you provide bitcode, all apps and frameworks in the app bundle need to include bitcode. For watchOS apps, bitcode is required.

What is Bitcode enabled app?

Bitcode is an intermediate representation of a compiled program. Apps you upload to iTunes Connect that contain bitcode will be compiled and linked on the App Store. Including bitcode will allow Apple to re-optimize your app binary in the future without the need to submit a new version of your app to the store.

Is it safe to disable Bitcode?

If you turn BitCode on, then the intermediate representation of the compiled program gets uploaded and Apple will able to recompile and/or optimize your apps for future architectures (as described here). Turning it off is very safe for the time being.


1 Answers

From this Apple Developers Forum discussion, user dshirley and bwilson suggest using command line tools otool and grep to check if bitcode sections exist.

$ otool -l libName.o | grep __LLVM 

or

$ otool -l MyFramework.framework/Versions/A/MyFramework | grep __LLVM 

Running the above command, if the library contains bitcode you will see segname __LLVM output.

like image 200
Michael M. Myers Avatar answered Oct 04 '22 22:10

Michael M. Myers