HD images and application size

I have 2 questions.

my application has high quality images, and I turned on the retina display (using cocos2d), so every png has hd: image-hd.png . my first question is: if you want it to also match iphones under 4 (3gs), should I have all my images again in 320x480 without -hd? I have a lot of images, and this method seems strange to me because it doubles the size of the application!

another thing. my application size is on a BIG drive, but I found that there is an init folder called: build, which is 136Mb ! he has simulator and debug files that are not mine.

how can i get into this folder that is so big? my app is 30mb only!

Many thanks

+4
source share
3 answers

Should I have all my images back at 320x480 without -hd?

Yes. If you want your game to work with devices other than Retina, then for each xxxx-hd.png you must provide the corresponding xxxx.png file.

this way seems strange to me because it doubles the size of the application!

He does not double it. It depends a little on the type of files (PNG, JPG) and how well you can compress images. Uncompressed, the SD image is a quarter of the size of the HD image. Thus, you are most likely looking at an increase in application size by 25%. If your HD assets weigh 100 MB, your SD resources will be added approximately 25 MB to the size of the application.

the size of my application on disk is BIG, but I found that there is an init folder called: build, which is 136Mb! It has a simulator and debug files that are not mine.

These are temporary build files created by Xcode . Do not delete them, because Xcode recreates the files anyway.

The size of your .app is the only file size you should consider. In addition, you should ignore the size of your .app in the debug builds that you were looking at. The only size of the application from which you can determine (or assume) the final size of the application in the App Store is the application created by the archive.

Launch Product → Archive with the iOS device selected as your current configuration (otherwise, the Archive will be grayed out). When this is done, the Xcode Organizer will open and highlight the newly created archive. Right-click and select "Show in Finder." There may be several .xcarchive files in this folder, select the last one and right-click on it, then select "Show package contents". Navigate to the product / applications that will display your .app and its size. This is the only size of your application that you should ever consider.

However, this is not the final size of your application in the App Store, since the .app package will be compressed (reduced), and at the same time, the executable will be encrypted (which makes compression impossible). I once wrote an article on how to determine the final size of the App Store in an application , which, it seems to me, is still preserved. Essentially, you copy the .app package, remove the executable from the package, compress the package, then add the compressed package size and the executable file size, and the result is a good approximation of the size of your application in the App Store.

+1
source

You need to specify a name for the HD image with the @ 2x prefix, for example image@2x.png . Leave the normal name for images to support lower versions of iOS - image.png . In code or Interface Builder, you should use only regular named images (all other things will be done automatically).

0
source

The short answer to the "image" part of the question is "YES", you should include normal size files. Perhaps this work is different from two resolutions (I am not an expert on graphics, but I suspect that it is much more than resizing the image). The whole point of implementing the -hd suffix was to be able to deploy a single package that works seamlessly for Retina and not Retina displays. I just had a change in requirements to switch from SD to SD + HD on one of my products ... errr ... now both artists and soft people in a crazy rush do exactly that: create a cover and define everything (i.e. e. there are no missing resources). Best of luck in changing your own needs.

0
source

Source: https://habr.com/ru/post/1397194/


All Articles