Skip to content

Calling Composite Demo Application Size

Patrick Latter edited this page Jul 5, 2022 · 9 revisions

IPA Size Breakdown

While App Store Connect provides the most accurate measurements of your app’s size, Xcode’s built-in reporting tools can create an app size report for you. It provides close estimates of your app’s download and installation sizes.

Create an App Size Report

  1. Archive your app in Xcode.
  2. Export your archived app as an Ad Hoc, Development, or Enterprise build.
  3. In the sheet for setting the development distribution options, choose “All compatible device variants” for app thinning, and enable Rebuild from Bitcode.
  4. Sign your app and export it to your Mac.

This process creates a folder with your app’s artifacts

  • A universal IPA file for older devices. This single IPA file contains assets and binaries for all variants of your app.
  • Thinned IPA files for each variant of your app. These files contain assets and binaries for only one variant.

The output folder for your exported app also contains the app size report, App Thinning Size Report.txt. This report lists the compressed and uncompressed sizes for each of your app’s IPA files. The uncompressed size is equivalent to the size of the installed app on the device, and the compressed size is the download size of your app.

Example

Variant: AzureCommunicationUIDemoApp.ipa
Supported variant descriptors: Universal
App + On Demand Resources size: 17.8 MB compressed, 53.7 MB uncompressed
App size: 17.8 MB compressed, 53.7 MB uncompressed
On Demand Resources size: Zero KB compressed, Zero KB uncompressed

App and dependency size analysis

Dependencies On Device Size Compressed Download Size
Sample App 4.5 MB 1.5 MB
Sample App + Calling SDK 46.3 MB 15.6 MB
Sample App + Fluent UI 7.8 MB 2.3 MB
Sample App + Calling SDK + Fluent UI + Mobile UI Calling 53.7 MB 17.7 MB

Based on the above size breakdown, we can see that the main contributor to the overall app size is the Calling SDK.

How to Reduce Application Size

Check Your Target’s Build Settings for Release Builds

After you’ve measured your app’s size, you may discover that it’s larger than you expected. This can happen if you’ve unintentionally changed the project’s settings. The default optimization level for the Release configuration is Fastest, Smallest [-Os], which can make your compiled binary very small. Check your target’s build settings, and be sure you’re using this optimization level.

Identify and Remove Unused Assets

Next, look inside your app’s IPA file to find out if your app contains unused assets or unnecessary files. First follow the steps described in Reducing Your App’s Size to create a thinned IPA file for each of your app’s variants. Then do the following:

Open Finder and navigate to the IPA file that you want to inspect.

Change the extension of the IPA file to ZIP. (An IPA file is just a ZIP archive that has a particular structure when unzipped.)

Unzip the file to show the app bundle inside the Payloads directory. You can either open the ZIP file in Finder, or run unzip -lv /path/to/your/app.zip in the Terminal app.

Right-click the app bundle, and choose Show Package Contents.

Where appropriate, remove any unused files from your Xcode project or targets. For example, make sure you’re not adding your app’s README file to a target, remove any unused image assets and header files, and so on.

Bitcode

Bitcode is an Apple technology that enables you to recompile your app to reduce its size. The recompilation happens when you upload your app to App Store Connect or export it for Ad Hoc, Development, or Enterprise distribution.

To enable Bitcode all dependencies must also have Bitcode enabled. At this time, Calling SDK does not support Bitcode, so enabling this is not possible.

Clone this wiki locally