What is App Thinning?Sarat PediredlaDevelopment
The launch of iOS 9 back in 2015 accumulated a lot of excitement around one feature in particular that has become a vital asset in a developer's toolkit — app thinning. When updating or creating apps for the new OS and all subsequent iOS releases, developers could use app thinning to reduce the size of apps utilising APIs introduced in iOS 9. Let’s take a closer look at what this feature is, and how it can help both developers and the users they are targeting.
How does app thinning work?
iOS 9 enabled mobile app developers to decrease the size of their app on users’ mobile devices through app thinning. The process involves using one or a combination of three processes, known as Slicing, On-Demand Resources and BitCode.
Nowadays, most apps developed for the iOS ecosystem are universal. In other words, a single app can be installed on all iPhones as well as iPads; there is no need to download separate apps for your smartphone/tablet. Although it’s far easier for users to simply download the app once and use it on all their devices, it does create an issue in terms of space on their device.
When an app is developed it needs to have visual and other assets, which enable it to work appropriately on each device. As the variety of iOS devices, screen sizes and capabilities grows, it means that when a universal app is downloaded it installs assets for all of these platforms.
Before app thinning was introduced, an app installed onto an iPhone 6 would include all the assets required for the iPhone 6, iPhone 6+ and other iPhones (if supported), as well as the resources required to run on iPads. These resources are never used on the iPhone 6, but they do take up a considerable amount of space on the user’s device.
Slicing enables mobile app developers to pack assets based on the device for which the app is being downloaded, meaning the user only installs the relevant assets. If the same user downloads the same app on another device, then only the assets required to run on that device will be installed.
This makes it easy for users to manage their storage and enjoy apps with fewer restrictions.
Since the launch of the App Store in 2007, apps have become ever more complex and sophisticated in terms of features and assets. For this to happen, developers have had to integrate lots of information and assets into their apps, enabling users to experience the full range of amazing features available. However, the fact is that many users do not use all the features or sections of an app means these extra assets for unused features take up storage space on the user’s device.
Games are a good example of this; it is very unlikely that a user who has progressed to the 50th level of a game would return to play the 3rd level. But before app thinning, apps stored all of the assets and data required to run all levels of the game. As apps became more complex and user's installed an increasing number of them on their devices, developers needed a way to free up space on devices. And one strategy for this was to temporarily delete assets for the first 20 or 30 levels and have them available online for the user to download when required.
Similarly, most apps come with in-app purchase options, which unlock features after purchasing them. But the assets and functions for these features were all previously saved on the device along with the app. Using on-demand resources mobile app developers can disable all the locked features during the installation process, and instead enable the user to download them when they purchase those features.
The final process of app thinning is bitcode. Usually, once a developer completes the development process on a mobile app, they upload a compiled binary file onto iTunes connect. This enables Apple to check the app, before making it available to all the users on the App Store.
However, the introduction of bitcode means developers will no longer upload a singular binary file, but an intermediate representation of a compiled program. This will be compiled on demand when installed by the user. Compilation occurs by Apple identifying the device that it's being installed onto, selecting the assets required for that particular device, and compiling them into a file ready for the user to install.
This feature works along with the rest of the two processes to ensure that the size of the app is kept to a minimum.
While those with top-end iPhone XS and XS Maxes might not be so concerned, one of the biggest advantages of this process is ensuring that 8GB and 16GB iPhones and iPads remain relevant, particularly important as developers and brands target emerging markets. The introduction of app thinning enabled mobile app developers to continue making apps for these devices, whilst enabling users to access more apps on their devices at a time.
All this may seem obvious now, but back in 2015 app thinning was genuinely revelatory. The suite of features introduced in iOS 9 provided developers with far more leeway when it came to the storage space required by their apps which, in turn, powered ever greater complexity and sophistication in the apps we use every day.
Want to learn more about how we develop mobile apps that offer a smooth experience for the end user? Read our latest case studies here.