Bitcode


Bitcode is an intermediate representation of a compiled binary. 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. PSPDFKit for iOS contains bitcode since version 5. Bitcode is also one of the largest factors in the size of our SDK.

Bitcode is just another form of LLVM IR, which is architecture-dependent. PSPDFKit ships with Bitcode slices for armv7 and arm64.

Bitcode is relevant for crash symbolication as well - be sure to read our articles about crash report symbolication and 3rd-party services.

Checking for Bitcode

Open a terminal and navigate into the PSPDFKit.framework folder.

Here is how to check what architectures are available:

Copy
1
2
$ lipo -info PSPDFKit
Architectures in the fat file: PSPDFKit are: i386 x86_64 armv7 arm64

Check if bitcode exists for a particular slice:

Copy
1
2
3
4
5
6
7
$ otool -arch arm64 -l PSPDFKit | grep LLVM
  segname __LLVM
  segname __LLVM

$ otool -arch armv7 -l PSPDFKit | grep LLVM
  segname __LLVM
  segname __LLVM

Some articles will recommend searching for bitcode. However, LLVM is a much better indicator for the existance of bitcode.

Stripping Bitcode

Xcode 7.2 added a new tool called bitcode_strip that allows to remove bitcode chunks from binaries:

Copy
1
$ xcrun bitcode_strip -r PSPDFKit -o PSPDFKit

Removing bitcode will disallow Apple to run binary optimizations on your behalf. You can verify that it worked by checking the file size, which should be significantly smaller than the original file, or use otool as listed above.

BCSymbolMaps

A BCSymbolMap is a lot like a dSYM for bitcode. Xcode builds that as part of creating the app binary and also for every dynamic framework. It's required for re-symbolicating function/method names to understand crashers. Symbol maps are per architecture, so there are currently two (armv7 and arm64) in PSPDFKit. You can learn more in the Framework Size article.

Learn More

Was this page helpful? We're happy to answer any questions.