What is Bitcode in iOS

You may compile and build iOS app using Swift and/or Objective-C every day, and you’ve probably you heard of Bitcode multiple times. So what exactly is the Bitcode, as some of you might see the configuration in the build phrase (Target -> Build Settings -> Enable Bitcode):

Bitcode is intermediate language that between frontend (OC, Swift and C) and backend (X86, PowerPC, ARM machine language).

A complete compile includes three main steps:

  • Frontend: compile frontend source code into Bitcode.
  • Optimizer: optimize the Bitcode based on the configuration, make the code run more efficiently, and reduce the size of app.
  • Backend: as known as CodeGenerator, which convert the ooptimized `Bitcode` into target architecture machine language, such as x86, PowerPC, ARM and so on.

Back to the top question, when Enable Bitcode is set to YES, the optimized Bitcode generated in the Optimizer step will be added to the app, and submitted to App Store. When Apple receives our Bitcode, Bitcode will be recompiled on the server side and generates a more usable version based on each of the platforms, such as the iPhone X, iPhone 11, iPad Pro 2018 and so on in order to shrink the size of the app size and run more efficiently.

If you like this story, please 👏👏👏, I will continue to share more tutorials.

Originally published at https://needone.app on October 14, 2020.





Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

A primer on error handling in Swift

Environment Variables in Xcode

iOS Data Storage: How to save/read local data in App?

Build a Chat App Interface With SwiftUI

Chat app

SwiftUI: Add a nice header skew animation to your views

SwiftUI: How to create a Horizontal Paging ScrollView?

Build a General Purpose API Kit With Combine

diagram showing the two-way flow of data between a user and a remote database through an API

iOS theming with tintColor and accentColor

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Needone App

Needone App


More from Medium

How to embed a UIKit Alert with Text Field in SwiftUI

An iPhone that displays an Alert with Text Field on a wooden table.

Access specifiers in Swift

how to covert sketchApp style “linear-gradient(-45deg, #00CC51 7%, #00CC8F 100%);” to swift?

CoreData search acceleration