Understanding Bitcode: An intermediate code

Source: Internet
Author: User

What is Bitcode?

Looking for something, the first thing to think about is to look at the official documents first. In the APP distribution Guide–app thinning (IOS, WatchOS) section, the following definition is found:

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

The Bitcode is an intermediate form of code that is compiled by the program. Programs that contain Bitcode configuration will be compiled and linked on the App store. Bitcode allows Apple to re-optimize the binaries of our program at a later stage without requiring us to resubmit a new version to the App Store.

Well, it looks pretty high.

Keep looking, in the What's New in Xcode-new Features in Xcode 7, there is a section of the following description

Bitcode. When you archive for submission to the app Store, Xcode would compile your app into an intermediate representation. The App Store would then compile the bitcode to the the or the executables as necessary.

When we submit a program to the App Store, Xcode compiles the program into an intermediate representation (Bitcode). The App Store then compiles the botcode into an executable 64-bit or 32-bit program.

Look at these two descriptions are placed in the app thinning (app slimming) section, you can see that it is related to the optimization of the package. Meow (@onevcat) also describes some of the improvements that Apple has made in app slimming in iOS 9 in the new features of the iOS 9 SDK that its blog developers need to know, and you can transition there to read it.

Bitcode Configuration

In the above error message, we mentioned how to handle the problem we encountered:

You must rebuild it with Bitcode enabled (Xcode setting Enable_bitcode), obtain a updated library from the vendor, or dis Able Bitcode for this target. For Architecture arm64

Either let the third-party library support or turn off the target's bitcode option.

In fact, in Xcode 7, when we create a new iOS program, the Bitcode option is set to Yes by default. We can see this setting in the "Build Settings", "Enable bitcode" option.

However, what we need to consider now is three platforms: Ios,mac Os,watchos.

    • The corresponding Ios,bitcode is optional.

    • is necessary for Watchos,bitcode.

    • MAC OS does not support Bitcode.

If we open the Bitcode, the following interface will also have a bitcode option when submitting the package:

Pirate diagram, my application is not able to display bitcode in this interface, because it relies on third-party libraries, and this library does not support Bitcode, temporarily only set Enable_bitcode to No.

Therefore, if our project needs to support Bitcode, it is necessary to require all the introduced third-party libraries to support Bitcode. I'll just have to wait for the company. What time does the Big Brother sister give us a new bag?

Off Topic

As mentioned above, Bitcode is an intermediate code. LLVM Official document has the format of introducing this file, interested can be LLVM bitcode file format.

Understanding Bitcode: An intermediate code

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.