How to Optimize the Size of the iOS Apps? Tips for iOS Developers

By Abhishek Amin May 12, 2021, 10:42:42 AM , In Mobile Apps
How to Optimize the Size of the iOS Apps? Tips for iOS Developers

I know what you as an iPhone user are thinking of! 

You are struggling to get the answer on why the iOS app size is bigger than other platforms. Tes, you are right. It’s not always the case that the videos and pics are the reasons behind the shortage of storage space on iPhones. 

The main reason behind the wastage of iPhone memory, aside from music, photos, and videos is cache. Any iOS application assembles a lot of caches, specifically if they do not clear cache. It should be taken care of during the time of the iPhone app development.

New times, Same Old Storage Problems

Gone are the days where the majority of iPhone users were using 16 GB iPhones. These days the minimum storage on a new iPhone is 64 GB. Still, it is believed to be half less than what it should provide. As a result, users may have to restrict themselves from taking videos and keeping pictures in the iPhone storage or else will have to compromise deleting some of the brilliant games occupying a good amount of space. The worst-case would be to go through all the documents in the file storage and delete them. It is a cruel but true fact that iPhone users have to delete apps in order to make space in the memory storage of the respective device.

In this article, we will see various aspects of the app size of the iOS apps and ways to optimize once they are launched on the App Store.

Why does iOS App Size need to be Optimized?

A few reasons have been understood from the user experience perspective.

Limited & Expensive Internet Data Packages

Not all users have the flexibility of data packages or broadband or wifi. There are still the majority of the users who are downloading the iOS applications from the Apple App Store over cellular connections. Updating the apps is still the same thing and hence the size of the apps becomes even important considering the limitation of using internet data on daily basis.

For Enhanced User Retention

There are maximum chances of an increase in user retention if the app sizes in iOS are optimized. Hence, any stakeholders of a brand new iOS app development project must consider the app size in order to increase user retention down the line.

Ignorance to App Size is not a Bliss

No matter how great your app could be from features and graphics point of view. The first experience of any app starts with the downloading process. A lengthy and never-ending spell of ‘time to first play’ could turn many app users disappointed, even before even they experience your mobile app. Many users may already have an extremely small amount of disk space the moment they explore your app and try downloading it.

AppStore limit for apps

  1. From iOS 13, an alert pops up while downloading an app of more than 200 MB in cellular connection. This notification alert can be customized to “Always Allow” or “Always Warn” when downloading in cellular connection.
  2. For iOS devices running with an OS version lower than iOS 12, it is mandatory for the apple device users to be connected with WiFi to download apps of more than 200 MB.
  3. The maximum size an iOS app can be submitted in AppStore is 4 GB
  4. Each Mach-O executable file (Exp.: app_name.app/app_name) must not exceed the following limits:
  • 4.1. For apps whose MinimumOSVersion is less than 7.0: maximum of 80 MB for the total of all __TEXT sections in the binary.
  • 4.2. For apps whose MinimumOSVersion is 7.x through 8.x: maximum of 60 MB per slice for the __TEXT section of each architecture slice in the binary.
  • 4.3. For apps whose MinimumOSVersion is 9.0 or greater: maximum of 500 MB for the total of all __TEXT sections in the binary.

All this data above is depicted on Apple Support.

Techniques to Reduce App Size in iOS Development

As a result, it becomes very important for iOS application developers to consider building and launching lightweight apps. App thinning is the technique used by the iOS dev community. There are three main ways in App Thinning. They are explained below:

App Slicing

In the early and mid-way launch of various iOS versions (before iOS 9 was launched), Apple used universal binary in the app bundle to be downloaded on all the iOS devices. As a result, the assets that are not needed on a specific device were downloaded in vain, which racks up significant storage.

App slicing is considered to be the most convenient way in slicing the app bundles to avoid this scene. The iOS app developers can upload a single IPA (iOS App Store Package)  to the app store connect. The Apple team will slice the whole pack into various segments of IPAs. 

This is based on the executable architecture and various resources needed on different devices. The iOS development team needs to put and add all the images to “Assets.xcassets” without fail. It is an asset catalog that is generated in Xcode. It will help the Apple team to identify images for specific devices.

As a result, any iPhone device will download the designated images while downloading the app. That will increase the downloading speed, reduce the app size, and save less storage on the iPhone.

Bitcode

An intermediate representation of a compiled program in iOS app development is called a Bitcode. It is kind of a bridge between iTunes and the Apple Store. An iOS app that is uploaded on iTunes Connect with a bitcode will be compiled and linked to the App Store. Using the bitcode, Apple itself recompiles apps using the latest version of the compiler.

This is the reason that iOS application developers would not need to submit or upload a new version of the app in the store. Instead, the bitcode will help the iPhone app to directly get linked to the store. The embedded bitcode enables Apple to recompile existing applications and make them compatible with the chipsets of new devices. The developers can optimize and re-optimize the iOS app code without submitting the new version every time. 

App slicing and bitcode are independent of each other. App slicing still happens even if bitcode is disabled.

On-demand Resources

As Apple explains, the on-demand resources are the resources that are different from the app contents and elements that are hosted on the App Store. These resources are separated from the related app bundle that users download from the App store. 

The purpose of on-demand resources is that any or many of them can float directly to the user app as and when required, instead of having them all at once without any specific need to be used. These on-demand resources can be hosted by TestFlight, an over-the-air installation service platform in iOS app development, on web servers.

All that iOS developers need to do is to assign a tag to the resource modules while developing an iOS app. So whenever there is a need for an on-demand resource, the respective resources can be identified and utilized. This helps in freeing up the storage space and reduces the app size significantly.

Why IndiaNIC is the Right Choice for iOS App Development?

Looking for the top iOS app development company? Your search ends here. IndiaNIC is an award-winning offshore mobile app development company since 1997. Having catered to global clients with unique technology expertise, client-centric methodologies, engagement, and guaranteed project deliveries over the web and mobile concepts.

Get in touch with us and unlock immediate access to hundreds of mobile resources with an average experience of 5 years.

Navigate
  • How to Optimize the Size of th...
  • Blog