5

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! :)

Wayne Shelley
  • 992
  • 10
  • 25

1 Answers1

2

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

Wayne Shelley
  • 992
  • 10
  • 25
  • I also see that app icons are not sliced, at least when I build and run the app on a device from xcode. I don't see a reason in your hypothesis. Can you explain why the app running on iphone would need to detect support for ipad? – jesse Feb 10 '17 at 23:44
  • For example, if there is a iPhone 6 or 6 plus launch image within the bundle, iOS knows that you have specifically built it to support that device type and uses the full resolution of the screen. I found this out by removing some of the images from the IPA and seeing the app stretched on iPhone 6. Its stupid I know! – Wayne Shelley Feb 12 '17 at 20:16
  • Sorry, I didn't get your point. Do you mean that if app is built for iPhone 6, it still needs launch image for iPhone 6 plus, otherwise it will be streched on iPhone 6? – jesse Feb 13 '17 at 00:28
  • No sorry. Apple are using the splashscreens to imply support for devices. So if iPhone 6 Plus splashscreen image is missing when you run the binary on an iPhone 6 Plus it assumes it was built for iPhone 6 and streches the whole app as opposed to using native res. – Wayne Shelley Feb 13 '17 at 10:42
  • Well, the app built for iPhone 6 Plus must include icon and launch image for iPhone 6 Plus, no doubt. But your initial question and also my current concern is about thinning. Including iPhone 6 launch image into .ipa for iPhone 6 Plus seems redundant to me. So I can't understand why it is still included, and how this relates to device support detection as was stated in your answer. – jesse Feb 13 '17 at 15:19
  • Indeed the launch images are not thinned. So everyone gets those massive iPhone 6 Plus splashscreens. But manually removing the iPhone 6 Plus image reduces support for iPhone 6 Plus. Well it was last year anyway! Hope that helps... – Wayne Shelley Feb 13 '17 at 18:31
  • Yeah, manual removing is not an option, since slicing is done by Apple servers. Thanks anyway for sharing your experience. – jesse Feb 13 '17 at 19:06
  • If you want to do more testing you can export your IPA for a specific device. All the best. https://developer.apple.com/library/tvos/documentation/IDEs/Conceptual/AppDistributionGuide/TestingYouriOSApp/TestingYouriOSApp.html#//apple_ref/doc/uid/TP40012582-CH8-SW17 – Wayne Shelley Feb 13 '17 at 19:33