9

Before iOS 9, our IPA size was roughly 6MB. After Archiving and exporting our IPA through Xcode 7, our IPA increased to about 17MB. Upon further investigation, we found out that enabling the "Bitcode" option in the export settings is what caused the large filesize jump.

My question is this: if we enable this option, will our IPA size be 17MB in the store? Or does Apple do something with the bundle to make it roughly the same size as before (6MB).

There's not much info about Bitcode out there right now, and I'd like to be informed before submitting to the store. 6MB and 17MB is enough of a difference to be concerned.

0xMatthewGroves
  • 3,181
  • 3
  • 26
  • 43
  • Isn't the idea to reduce app size on the devices, not the app store? – trojanfoe Sep 23 '15 at 17:27
  • 1
    Well your app includes the bitcode in it with that option turned on so it makes sense that it makes the size bigger. I would assume that the bitcode doesn't get included in the file that users will be downloading from the app store, but I can't confirm that. – dan Sep 23 '15 at 17:29
  • 3
    This is what I want to know. I'm not releasing with bitcode if it means my users have to sit there and download an app that's 3x of what it should be. I'd probably lose downloads. Smaller is better. I could care less how much space it takes up on Apple's servers. Cause screw them. – 0xMatthewGroves Sep 23 '15 at 17:30
  • @FrostRocket . Did you solve this problem. I also want to know if size will appear larger on App Store if bit code is enabled than the size that app store will show if bit code is disabled. Thanks – ila Dec 16 '15 at 10:03
  • 1
    @ila We enabled bitcode by accident (Apple checks the option automatically), and saw that some devices it was actually larger, and some were smaller. This is for the size reported on the app store. I would leave it off for now until they can promise more predictable results. It's an underwhelming result for sure. – 0xMatthewGroves Dec 17 '15 at 19:14
  • Also, the size of the generated IPA was definitely way larger than the one that was on the store. So don't worry that your 8mb app is 45mb when you submit it, it'll end up being much less for users that download it. – 0xMatthewGroves Dec 17 '15 at 22:23
  • My IPA went from 8MB to 26MB when archived and extracted and also went from 10MB to 18MB on Testflight. Holy crap – genaks Jun 02 '16 at 08:50

1 Answers1

18

Bitcode is an intermediate representation of a compiled program. Enabling it will increase the build (ipa) size on the developer front.

iOS can run on different CPUs (i386, x86_64, arm, arm64, etc.), if you want to run a program on any iOS setup, then the program should contain object code for each platform. When you run a program, OS reads the ‘Table Of Contents’ and looks for a slice corresponding to the OS CPU. For instance, if you run on x86_64, then OS will load object code for x86_64 into memory and run the program.

Currently, all the apps on the AppStore contain object code for arm and arm64 CPUs. Moreover, third-party proprietary libraries or frameworks contain object code for i386, x86_64, arm, and arm64, so you can use them to test the app on device and/or simulator.

How does the Bitcode works? When you submit an app (including Bitcode) Apple’s ‘BlackBox’ recompiles it for each supported platform and drops any ‘useless’ object code, so AppStore has a copy of the app for each CPU. When an end-user wants to install the app - she installs only the version for a particular processor, without any unused stuff.

Bitcode might save up to 50% of disk space per program.

Reference: http://lowlevelbits.org/bitcode-demystified/

auspicious99
  • 3,902
  • 1
  • 44
  • 58
Santosh Botre
  • 549
  • 5
  • 21