0

I have an iOS app built in Xcode 6 which uses an Asset Catalog to store 71MB of images. I have only includes the @3x images in my Asset Catalog to try and keep the size of the app under 100MB. The only exception to the @3x rule is that I have included @1x and @2x images for the AppIcon group.

All images are .JPG files with the exception of the AppIcon files which are .png files.

When I archive and create an .IPA file, the size of the IPA is 117MB. When I open and look at the size of the Asset.car file within the .IPA I see that it is 130MB. Contrast this to the Asset Catalog in the project which is 71MB. I am pointing this out to be clear that it's not other compiled code that is taking up 40 MB.

I would like to archive this app so that the file size stays under 80-90-MB if possible. The IPA should stay under 100MB given the 70MB of assets but I would like to know how to accomplish this or what other steps I might need to take or review to see why I am getting 130MB of an asset file in the IPA for 70MB of images.

halfer
  • 19,824
  • 17
  • 99
  • 186
Shaun
  • 4,057
  • 7
  • 38
  • 48
  • Looking at the assets in the ipa vs in the Asset Catalog are there more assets or are the are they larger? If the latter which ones are larger? – zaph Feb 03 '15 at 15:26
  • Are you using PNGs or JPEGs? If you use PNG you can add that to the asset catalog and it will compress them for you and more or less turn them into a image map. We had a similar issue on our app when trying to use JPEGs in the asset catalog, we ended up pulling those out and putting them in the `Resources` folder. – CWitty Feb 03 '15 at 15:34
  • @cwitty- I clarified the file type. – Shaun Feb 03 '15 at 17:31
  • @zaph-The Assets.car file in the IPA is 132.1MB where as the Assets Catalog folder size in the project is 70MB. – Shaun Feb 03 '15 at 17:32
  • Are the files in the app ipa Asset Folder also jpg? Or have some of them been changed? Perhaps a different compression setting. You need to compare some files from the source project to the ipa. – zaph Feb 03 '15 at 17:39
  • Hey @zaph There is no App ipa Asset Folder. There is only an Asset.car file which is all of the images put together in a proprietary format. Is there some way you can suggest opening those so that I can review and answer the question? – Shaun Feb 04 '15 at 01:07
  • Get [cartool](https://github.com/steventroughtonsmith/cartool), build and run against your Assets.car file. Then compare with what you expect. It is a simple command line tool. – zaph Feb 04 '15 at 02:49
  • Hi Shaun. Regarding downvotes, I wouldn't worry about them. If you would like to remark upon them, or to ask for feedback, it is best to add a comment (though there is not much value in that either, in my view). We try to discourage voting commentary in posts themselves, since most future readers will not vote, and so this discussion won't be of interest to them. Thanks! – halfer Sep 24 '15 at 13:25

2 Answers2

1

There is a new CAR tool: iOS-Asset-Extractor. This seems to be a better solution than "cartool" below.

Get cartool, build and run against your Assets.car file. That will create a directory containing the image files from the Assets.car.It is a simple command line tool. Not perfect but that should give you help understanding what is going on.

Then compare with what you expect and hopefully you will be able to figure out what is going on..

From what I understand .jpg files are converted to .png. If you have assets that are large consider including them directly or as a folder reference. This is particularly true if you are reading in the images in your code.

zaph
  • 111,848
  • 21
  • 189
  • 228
0

The article at Assets.car is 6 times larger than actual Images.xcassets folder when archived seems to be the answer.

The entire set of JPEGs in my Asset Catalog is converted to PNG's which are substantially larger. I converted everything except for my AppIcons and LaunchImage out of the Asset Catalog and into a normal folder. So at that point i had a folder full of JPEGs and a small Asset Catalog.

When I created an archive it was 67 MB so significantly smaller!

Community
  • 1
  • 1
Shaun
  • 4,057
  • 7
  • 38
  • 48