iOS App Slicing 或 Thinning 不起作用

iOS App Slicing or Thinning is not working

我目前正在尝试优化我的 iOS IPA 的大小,并希望新的 'iOS App Slicing' 能够减少最终输出中包含的图像数量。好像不是这样的。

我正在构建 iOS 9.3,部署目标(7.0 - 虽然也尝试过 9.3 无济于事)。这是一个通用应用程序,应用程序 icons/launch 图片位于资产目录中(以及其他一些图片资源)。

为了测试切片,我按照此处的说明进行操作: https://developer.apple.com/library/tvos/documentation/IDEs/Conceptual/AppDistributionGuide/TestingYouriOSApp/TestingYouriOSApp.html#//apple_ref/doc/uid/TP40012582-CH8-SW17

App Thinning Size Report 显示设备类型之间的大小差异很小,iPad 和 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

在对进程导出的 'Specific Device Variants' 的进一步调查中,我发现没有发生明显的切片。

iPhone 5 设备变体的应用负载 - 解压缩 IPA 后:

如果我对切片的理解是正确的,那么其他 iOS 设备(例如 iPhone 6+、iPads)不应该有图标或启动图像

这是我的资产目录的内容(在 xcode 和 finder 中)如果有帮助的话:

提前致谢! :)

回答我自己的问题:

我目前的假设是启动图像和图标不是 thinned/sliced。这是因为它们通常用于在发布时检测对某些设备的支持。

但是,我可以确认 Asset Catalog 中的其他图像资源已正确细化。

您可以通过解压缩 IPA 和 运行 IPA 中 Assets.car 文件中的 CARExtractor 工具来检查。

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