iOS Binary Size

This article is about the size of Leanplum iOS SDK as well as the App Store binary guidelines.

Leanplum SDK size

The compiled Leanplum framework on Github is 14.3 MB and the xcframework 15.4 MB, however, this is a false measurement of the actual binary size. While the framework is built to support all architectures (arm64, arm7, etc.), much of this will be stripped out when the binary is made.

To better estimate our SDK binary size, we compare the ipa files between an app with the Leanplum-iOS-SDK installed and the same app without it. (ipa is what the App Store uses for submission). This can be created by selecting Archive > Export in XCode.

Leanplum-iOS-SDK:

  • 4.0.0 - 357 KB (xcframework)
  • 3.2.1 - 308 KB (xcframework)

App store binary limit

There are several things you need to keep in mind when submitting your binary to the App Store:

  • The maximum binary size is 4GB.
  • The binary size limit for cellular download is 200MB.
  • Each file has a limit of roughly 60~100MB depending on target OS version.

Given these limitations, the Leanplum SDK will be roughly 0.16% of the cellular download limit. You can read more about Apple’s guidelines here.

App thinning

App Thinning is an optimization that Apple does when you submit your app to the App Store:

Slicing

This is a process of removing the unused resources (1x, 2x, 3x files) for each device. For the iPhone 4S, for example, it will only download 1x files.

Bitcode

An intermediate representation of an app that developers upload to the App Store. This allows the App Store to build 32-bit or 64-bit versions as needed, and Apple can apply new optimizations in the future without submitting a new app to the App Store. Enabled by default.

Reducing Binary Size

If your app is hitting the limit and you need to decrease your binary size, here are some optimization tips:

  • Set Optimization Level to Fastest or Smallest. This will reduce the binary size dramatically.
  • Set some resources to be On-Demand and determine when it should be downloaded. Read more from Apple here.
  • Download resources in the background.
  • Optimize image and audio. For PNG, if possible use 8-bit instead of 32-bit. Make sure to compress audio using AAC or MP3.
  • If you have long strings or tables, move them to external files as they will be compressed.
  • Use Asset Catalogs so that app can be Sliced.

There are many more optimizations that can be done. You can read more about optimization and technical overview here.

If you have any other questions about the Leanplum iOS SDK or App Store optimization, contact Leanplum support.