xcode – iOS App Size much bigger than expected using SVGs


We are working on optimizing the size of our app, and there is something we can’t figure out. It looks like Xcode includes rasterized versions of our SVG images, increasing the size of our app significantly.

Given these steps:

  1. Create a project from scratch in Xcode 15 (or 14.2)
  2. Add an SVG in the .xcassets with “Single Scale” and “Preserve Vector data” (like this one, notice it’s 9KB)
  3. Select Team and then Archive
  4. Export AdHoc and select a device to do the App Thinning (I usually use iPhone 14)
  5. Change .ipa to .zip, decompress .zip and “Show Package Contents” in .app
  6. Notice Assets.car size, over 100KB
  7. Run xcrun --sdk iphoneos assetutil --info Assets.car and check the json, notice there is a vector image, but also images @1x and @3x, adding up over 90KB (because these are not vectors)

Why is Xcode adding rasterized images in the .car apart of the vectorial one? This is increasing our app size some MBs (we have many SVGs), which I think is unnecessary and goes against the idea of using vectors in my opinion.

Does someone have a clue why is this happening? Thanks!

Latest articles

spot_imgspot_img

Related articles

Leave a reply

Please enter your comment!
Please enter your name here

spot_imgspot_img