Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS App Slicing or Thinning is not working

I'm currently trying to optimise the size of my iOS IPA and was hoping that the new 'iOS App Slicing' would reduce the amount of images included in the final output. This doesn't seem to be the case.

I'm building on iOS 9.3, deployment target (7.0 - although also tried 9.3 no avail). It's a universal app and the app icons/launch images are in an asset catalog (along with some other image resources).

To test the slicing I followed the instructions here: https://developer.apple.com/library/tvos/documentation/IDEs/Conceptual/AppDistributionGuide/TestingYouriOSApp/TestingYouriOSApp.html#//apple_ref/doc/uid/TP40012582-CH8-SW17

The App Thinning Size Report showed very little difference in size between the device types and there should be a considerable difference between an iPad and iPhone!

App Thinning Size Report for All Variants of myApp

Variant: myApp-iPad (4th generation)-etc.ipa
Supported devices: iPad (3rd generation) and iPad (4th generation)
App + On Demand Resources size: 71.8 MB compressed, 90.3 MB uncompressed
App size: 71.8 MB compressed, 90.3 MB uncompressed
On Demand Resources size: Zero KB compressed, Zero KB uncompressed


Variant: myApp-iPad 2-etc.ipa
Supported devices: iPad 2 and iPad mini
App + On Demand Resources size: 71.6 MB compressed, 90.1 MB uncompressed
App size: 71.6 MB compressed, 90.1 MB uncompressed
On Demand Resources size: Zero KB compressed, Zero KB uncompressed


Variant: myApp-iPad Pro (12.9-inch).ipa
Supported devices: iPad Pro (12.9-inch)
App + On Demand Resources size: 71.5 MB compressed, 90.9 MB uncompressed
App size: 71.5 MB compressed, 90.9 MB uncompressed
On Demand Resources size: Zero KB compressed, Zero KB uncompressed


Variant: myApp-iPad Pro (9.7-inch).ipa
Supported devices: iPad Pro (9.7-inch)
App + On Demand Resources size: 71.5 MB compressed, 90.9 MB uncompressed
App size: 71.5 MB compressed, 90.9 MB uncompressed
On Demand Resources size: Zero KB compressed, Zero KB uncompressed


Variant: myApp-iPad mini 3-etc.ipa
Supported devices: iPad Air, iPad mini 2, and iPad mini 3
App + On Demand Resources size: 71.5 MB compressed, 90.9 MB uncompressed
App size: 71.5 MB compressed, 90.9 MB uncompressed
On Demand Resources size: Zero KB compressed, Zero KB uncompressed


Variant: myApp-iPad mini 4-etc.ipa
Supported devices: iPad Air 2 and iPad mini 4
App + On Demand Resources size: 71.5 MB compressed, 90.9 MB uncompressed
App size: 71.5 MB compressed, 90.9 MB uncompressed
On Demand Resources size: Zero KB compressed, Zero KB uncompressed


Variant: myApp-iPhone 4S.ipa
Supported devices: iPhone 4S
App + On Demand Resources size: 71.8 MB compressed, 90.3 MB uncompressed
App size: 71.8 MB compressed, 90.3 MB uncompressed
On Demand Resources size: Zero KB compressed, Zero KB uncompressed


Variant: myApp-iPhone 5-etc.ipa
Supported devices: iPhone 5 and iPhone 5c
App + On Demand Resources size: 71.8 MB compressed, 90.3 MB uncompressed
App size: 71.8 MB compressed, 90.3 MB uncompressed
On Demand Resources size: Zero KB compressed, Zero KB uncompressed


Variant: myApp-iPhone 5s.ipa
Supported devices: iPhone 5s
App + On Demand Resources size: 71.5 MB compressed, 90.9 MB uncompressed
App size: 71.5 MB compressed, 90.9 MB uncompressed
On Demand Resources size: Zero KB compressed, Zero KB uncompressed


Variant: myApp-iPhone 6 Plus.ipa
Supported devices: iPhone 6 Plus
App + On Demand Resources size: 71.9 MB compressed, 91.2 MB uncompressed
App size: 71.9 MB compressed, 91.2 MB uncompressed
On Demand Resources size: Zero KB compressed, Zero KB uncompressed


Variant: myApp-iPhone 6.ipa
Supported devices: iPhone 6
App + On Demand Resources size: 71.5 MB compressed, 90.9 MB uncompressed
App size: 71.5 MB compressed, 90.9 MB uncompressed
On Demand Resources size: Zero KB compressed, Zero KB uncompressed


Variant: myApp-iPhone 6s Plus.ipa
Supported devices: iPhone 6s Plus
App + On Demand Resources size: 71.9 MB compressed, 91.2 MB uncompressed
App size: 71.9 MB compressed, 91.2 MB uncompressed
On Demand Resources size: Zero KB compressed, Zero KB uncompressed


Variant: myApp-iPhone 6s.ipa
Supported devices: iPhone 6s
App + On Demand Resources size: 71.5 MB compressed, 90.9 MB uncompressed
App size: 71.5 MB compressed, 90.9 MB uncompressed
On Demand Resources size: Zero KB compressed, Zero KB uncompressed


Variant: myApp-iPhone SE.ipa
Supported devices: iPhone SE
App + On Demand Resources size: 71.5 MB compressed, 90.9 MB uncompressed
App size: 71.5 MB compressed, 90.9 MB uncompressed
On Demand Resources size: Zero KB compressed, Zero KB uncompressed


Variant: myApp-iPod touch (6th generation).ipa
Supported devices: iPod touch (6th generation)
App + On Demand Resources size: 71.5 MB compressed, 90.9 MB uncompressed
App size: 71.5 MB compressed, 90.9 MB uncompressed
On Demand Resources size: Zero KB compressed, Zero KB uncompressed


Variant: myApp-iPod touch.ipa
Supported devices: iPod touch
App + On Demand Resources size: 71.8 MB compressed, 90.3 MB uncompressed
App size: 71.8 MB compressed, 90.3 MB uncompressed
On Demand Resources size: Zero KB compressed, Zero KB uncompressed


Variant: myApp.ipa
Supported devices: Universal
App + On Demand Resources size: 75.3 MB compressed, 99.9 MB uncompressed
App size: 75.3 MB compressed, 99.9 MB uncompressed
On Demand Resources size: Zero KB compressed, Zero KB uncompressed

On further investigation of the 'Specific Device Variants' exported by the process I could see that no apparently slicing was occurring.

App Payload for iPhone 5 Device Variant - After unzipping IPA:

App Payload - After unzipping IPA

If my understanding of slicing is correct there should not be icons or launch images for other iOS devices (e.g. iPhone 6+, iPads)

Here is the contents of my asset catalog (in xcode and finder) if it helps:

asset catalog

asset catalog in finder

Thanks in advance! :)

like image 292
Wayne Shelley Avatar asked Oct 31 '22 05:10

Wayne Shelley


1 Answers

Answering my own question:

My current hypothesis is that Launch Images and Icons are not thinned/sliced. This is because they are often used to detect support for certain devices at launch.

However, I can confirm that other image resources in the Asset Catalog are thinned correctly.

You can check by unzipping the IPA and running the CARExtractor tool on the Assets.car file within the IPA.

https://github.com/Marxon13/iOS-Asset-Extractor/tree/master/CARExtractor

like image 55
Wayne Shelley Avatar answered Nov 15 '22 06:11

Wayne Shelley