What is BitCode in ios

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.

When you archive for submission to the App Store, Xcode will compile your app into an intermediate representation. The App Store will then compile the bitcode down into the 64 or 32 bit executables as necessary.

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.

As far as Bit code and enabling bit code is concerned, the first thing which is required to understand is the story from where all this started.

So, basically if I talk of ENABLE_BITCODE which is introduced in iOS 9, is a part of App Thinning process.

And it is a part of problem which answers “How did Apple manage to reduce the storage size of iOS 9 to 1GB from 5 GB in iOS 8?

This is due to a new technology called ‘App Thinning’

& what exactly is App Thinning ?

App Thinning brings down the iOS 9 OTA update from 4.6GB to 1.3GB, a 71% size reduction. Not only will this help with future OTA updates, but the technology will be available for developers to reduce the storage required by third party apps.

App thinning has basically three components namely- slicing, bitcode, and on-demand resources.

Facing linker error in xcode 7  ???

Ok, you can manage the bitcode set to YES or NO, select target in your xcode project > build settings & search bitcode > in section build options you can set to it NO or YES if you needed.

If you are getting linker error   means you  have  some SDK without bitcode in your project so either  replace the SDK with new bitcode enabled SDK or set the ENABLE BITCODE to NO for your ios project.  Remember that bitcode is default but optional for ios but required for watchOS.

anna

App Slicing: iOS apps are developed to run on a variety of devices, so they come with code to support all them, whether or not your particular device requires it. App Slicing will allow your device to download only those files required by our device. Example: you don’t need the 3x iPhone 6 Plus assets if you’re running a 4-inch model.

On-Demand Resources (ODRs): It works on the idea that an app probably doesn’t need its entire library of resources at any given time, so parts of it can be downloaded or deleted as needed. Developers will be able to specify what code is needed at what times by tagging sections of code as ODRs. These portions will be automatically downloaded from the App Store when they are required and deleted when they won’t be needed again.

Bitcode: It refers to an “intermediate representation” of an app that developers will upload to the App Store rather than a pre-compiled binary. This works hand-in-hand with App Slicing, allowing the bitcode to be compiled on demand as 32-bit or 64-bit, depending on the downloading device. This will also allow any compiler improvements made by Apple to be implemented automatically, rather than having developers resubmit their apps.