This article will talk 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 14MB; 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 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.
Here are the results from Leanplum-iOS-SDK 1.4.1 to 1.5.1.
- 184.108.40.206 = 1.09 MB (1,090,469 KB)
- 1.4.1 = 1.095 MB (1,095,572 KB)
- 1.4.2 = 1.096 MB (1,096,667 KB)
- 1.5.1 = 1.019 MB (1,019,377 KB)
220.127.116.11 to 1.4.2 shows that the size of the SDK is going up. This is because we are constantly working on adding new features and enhancements.
However, you can see that in 1.5.1 the size of the dynamic library decreased. We removed our old networking library that used the deprecated NSURLConnection and replaced it with our own NSURLSession based library.
In 2.0.0, we will move the UI Editor to a separate module, which will decrease the SDK size for people who are not using the Editor.
Although the binary size will inevitably increase over time with new features, we are constantly looking for ways to decrease the size of the SDK. We understand that customers want a powerful, and lightweight SDK that enhances customer engagement.
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 100MB.
- Each file has a limit of roughly 60~100MB depending on target OS version.
Given that, the Leanplum SDK will be roughly 1% of the cellular download limit. You can read more about Apple’s guidelines here.
App Thinning is an optimization that Apple does when you submit your app to the App Store:
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.
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 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, feel free to contact support get more information.