Xcode Assets: pdf/svg increase final ipa's size

Reproduce

With Xcode 14.1, following steps can reproduce the phenomenon:

  1. add a pdf file to the assets, and in attributes inspector, select "Preserve Vector Data", set "Scales" as "Single Scale".

  1. run Xcode->Product->Archive

  2. follow the instruction of create the app size report from apple official site. In the archives list, select "Distribute App" -> Ad Hoc ->App Thinning: All compatible device variants -> Next -> Automatically menage signing -> Next -> Export.

  3. Now we check the exported folder, choose one specific ipa (not the universal one), we can choose one base on file "App Thinning Size Report.txt". unzip that ipa, enter the app folder, now we can find the file which name is "Assets.car",

  4. we run the script "xcrun --sdk iphoneos assetutil --info Assets.car", then we get a output message, part of it like this:

{
    "AssetType" : "Image",
    "BitsPerComponent" : 8,
    "ColorModel" : "RGB",
    "Colorspace" : "srgb",
    "Compression" : "deepmap-lzfse",
    "Encoding" : "ARGB",
    "Idiom" : "universal",
    "Name" : "pdf",
    "NameIdentifier" : 19593,
    "Opaque" : false,
    "PixelHeight" : 842,
    "PixelWidth" : 595,
    "Preserved Vector Representation" : true,
    "RenditionName" : "pdf.pdf",
    "Scale" : 1,
    "SHA1Digest" : "5C71A688035EDA13684D904E6F272BC9B0F7ABF8D5AFE1C44915FDC99AB5DC4E",
    "SizeOnDisk" : 71134,
    "State" : "Normal",
    "Template Mode" : "automatic",
    "Value" : "Off"
  },
  {
    "AssetType" : "Image",
    "BitsPerComponent" : 8,
    "ColorModel" : "RGB",
    "Colorspace" : "srgb",
    "Compression" : "deepmap-lzfse",
    "Encoding" : "ARGB",
    "Idiom" : "universal",
    "Name" : "pdf",
    "NameIdentifier" : 19593,
    "Opaque" : false,
    "PixelHeight" : 2526,
    "PixelWidth" : 1785,
    "Preserved Vector Representation" : true,
    "RenditionName" : "pdf.pdf",
    "Scale" : 3,
    "SHA1Digest" : "BB0E06CEB24DBF6A89D38BAFCBAE5D6322CED922FDD30E4A5E4A22C9079B7390",
    "SizeOnDisk" : 369765,
    "State" : "Normal",
    "Template Mode" : "automatic",
    "Value" : "Off"
  },
  {
    "AssetType" : "Vector",
    "Colorspace" : "generic",
    "Height" : 842,
    "Idiom" : "universal",
    "Name" : "pdf",
    "NameIdentifier" : 19593,
    "RenditionName" : "pdf.pdf",
    "Scale" : 1,
    "SHA1Digest" : "03F9900F23A26D421A8A612372849CCFB2952E7C47D99DA514B770AE1908C283",
    "SizeOnDisk" : 43409,
    "State" : "Normal",
    "Value" : "Off",
    "Width" : 595
  }

This means there are 3 files in the Assets.car. And we can use some tools to export them out. e.g QLCARFiles and we can get these 3 files.

-rw-r--r--   1 xxxxx  staff   43185 Nov 10 21:20 pdf.pdf
-rw-r--r--   1 xxxxx  staff  113023 Nov 10 21:20 pdf-UIAppearanceAny.png
-rw-r--r--   1 xxxxx  staff  343966 Nov 10 21:20 pdf-UIAppearanceAny@2x.png

My question is

as I already selected "Preserve Vector Data" in Xcode, why my device still get two unnecessary png files?

In my opinion, what my device need is only that pdf.pdf file, do not need these two png file.(pdf-UIAppearanceAny.png / pdf-UIAppearanceAny.png), these have no benefit except increased unnecessary ipa's size.

Xcode Assets: pdf/svg increase final ipa's size
 
 
Q