Monday, July 6, 2015

App Thinning iOS 9.0 - Basics


App thinning is for iOS and watchOS. The Appstore and the Operating System minimize the installation of iOS and watchOS apps by tailoring app delivery to the capabilities of users particular device, with minimal footprint. The App thinning lets developers to create apps that use most of the features occupy minimum disk space and accommodate future updates that can be applied by Apple. There are mainly three parts involved in the app thinning process. 

1. Slicing (iOS)
2. Bitcode (iOS, watchOS)
3. On-Demand Resources(iOS) 

Slicing is the process of creating and delivering variants of the app bundle for different target devices. A variant contains only the executable architecture and resources that are needed for the target devices. A developer will continue to develop and upload full version of the app to iTunes connect. The app store will create and deliver different variants based on the device app supports Image resources are sliced according to their resolution and device family. GPU resources are sliced according to the device capabilities. When the user installs and app, a variant for the user’s device is downloaded and installed. 

For iOS app, sliced apps are supported on the latest iTunes version and device running on iOS 9.0 and later. Otherwise app store delivers universal app to the devices. 

Below are the steps to be followed for slicing

1. In Xcode, specify target devices and provide multiple resolutions of the image in the asset catalog. A developer must use asset catalog in order for the slicing to work.  
2. Build and run the app in simulator device 
3. Create an archive of the app and export a variant locally for target device. 
4. Upload to iTunes connect
5. In iTunes connect, distribute the pre-release version of the app to designated testers. 

Bitcode
Bitcode is an intermediate representation of a compiled program. Apps that a developer upload to iTunes connect that maintain the bitcode will be compiled and linked on the app store. Including bitcode will allow apple to re-optimize the app binary in the future without need to submit new version of the app to the store. 

On Demand Resources
On demand resources are resources an app can tag with keywords and request in groups by tag. The App store hosts the resources on Apple servers and manages the download for the app. On-Demand resources enable faster downloads and smaller app sizes. 

The OS purges the on demand resources whenever the diskspace is low. IF the deverloper is trying to test this concept outside the app store, then it needs to host the resources themselves. For users, on-demand resources work transparently in background supplying resources as needed while the user explores the feature of the app.  

References:

No comments:

Post a Comment