AWS Mobile Blog

Why is the AWS SDK for iOS so big?

by Yosuke Matsuda | on | Permalink | Comments |  Share

Version 2 of the AWS Mobile SDK

  • This article and sample apply to Version 1 of the AWS Mobile SDK. If you are building new apps, we recommend you use Version 2. For details, please visit the AWS Mobile SDK page.
  • This content is being maintained for historical reference.

This is a question we have seen a number of times on various Internet forums, and we’d like to address it here. When you download the AWS SDK for iOS and uncompress it, you may notice the SDK as a whole is over 150 MB and the AWSiOSSDK.framework alone is over 70 MB. You may wonder "does this mean when I include AWSiOSSDK.framework in my project, my app will be over 70 MB?" Don’t worry. The framework is not going to add 70+ MB to your app. In most cases, the increase barely affects the size of your app. Here’s why.

The SDK download includes source and samples

The .zip file you download from https://aws.amazon.com/sdkforios/ includes not only the binary framework, but also the source code for the entire framework and a number of samples that demonstrate how to use the framework in your app. These samples and source code will not affect your app size in any way and should provide helpful information on ways you can use the SDK as well as best practices.

Only what you use in your app will be included in your app binary from the framework

AWSiOSSDK.framework contains a static library, and object code in the library is incorporated in your app binary file at build time. Xcode is smart enough to figure out what objects from the framework are necessary for your app and includes just those objects in your app.

For example, if you only use Amazon DynamoDB in your app and none of the other supported services, your app won’t include object code for those other services. Unless you use every single object and operation from the framework, only a portion of the code from the framework will be included in your app.

The framework contains three architectures, while apps on a device need at most two

We currently compile the AWS SDK for iOS for three architectures: armv7s, armv7, and i386. If you want to optimize your app for new devices including iPhone 5, you will need to build your app with armv7s support. Other older iOS devices that the AWS SDK for iOS supports use the armv7 architecture. Since the new CPU architecture (armv7s) is also capable of running armv7 code, you can build your app with armv7 support only if you don’t need to optimize your app specifically for armv7s.

The iPhone simulator uses i386 because it runs on the Mac. We support the i386 architecture so that the users can run their apps with our framework on the simulator for testing. i386 support is useful, almost essential, for testing, but i386 code is unnecessary for apps on the iOS devices. Therefore, even if you use every single object from the AWS SDK and support both armv7s and armv7 architectures, your app will never use about a third of the code included in the framework, and the unused code won’t be included in your app that you submit to Apple.

Apps on the App Store are compressed

After you submit your app to Apple, it is encrypted for DRM purposes and re-compressed. This leads to an even smaller footprint.

I hope this information makes you more confident that the AWS SDK for iOS is not going to bloat your apps. If you have any further comments or questions about this topic, we’d love to hear from you. Please leave a comment below!