I am trying to submit an application in App Store, and I need to decrease its memory a little bit, if this is possible. I tried a method which I am gonna describe below to m
I came across an article in the web which explains the process in the following 9 points:
Ensure that you have reached the maximum level of iOS stripping, for more info on iOS stripping, see this post.
Enabling bitcode DOES increase the size of your over-the-air download. In our case, it was the difference between 130 and 70MB. If you wish to turn bitcode off, you can do so in your xcode project, or using a post build attribute such as this one.
The Launch image in your xcode project is NOT optimized. While running something through a compression algorithm doesn’t work because Unity decompresses and stores images without much compression in order to decrease startup time, it does work for the launch images that are generated by Untiy after project generation.Run all your images through a lossless compression algorithm in order to save a few MBs (10 in our case).
If this isn’t enough, it’s time to start looking at your asset logs. Run your build in Unity and open the Editor log, it’s this ridiculously small icon next to your console preferences. In our case, they are already optimized. With a 111MB in uncompressed assets, we were able to achieve an over-the-air size of 70MB. Go over each asset and change the resolution to the lowest possible quality that your users won’t notice. The best compression setting is PVRTC for iOS. While you are at it, check out Resource Checker in order to see large textures in-memory. Reducing the resolution on these will also decrease build size, as well as memory consumption. Also, please use sprite atlases – you will see the wonders this does!
Check for unused libraries in your project, or libraries that are using far too much space for their functionality. Commands such as df and ls -lh might come in useful here, run these in your project files and see which files really stand out and need to be reduced in size. Keep in mind that these individual libraries do not necessarily have the same build effect as your textures – generally, these are compiled for multiple architectures, and if a library is 20MB, it generally only affects your build size by about 6MB, due to the fact that libraries often include architecture support for i386, arm64, and arm7 in the same library
Check that the /Plugins/Android is not included in your iOS project. See this post for more information.
Make sure you don’t have any unused scenes in your build settings.
Build your project, and check out the archive before you submit it to iTunes Connect. You can do so by clicking “Product -> Archive”, letting it archive, and when it’s done, “Window -> Organizer” to pop up this interface and find the build location.
Under “Products/Applications/game.app” Run the mv command to turn your .app into a browsable directory.In this directory you’ll be able to see a lot of the stuff we did, and also find inspiration for more things you can do.
Now, there are a lot more things that could result in a bigger than expected build size, and I’m sure there are a lot more things you can to do get below it also.
If you’d like to add to this list, or have further questions (I’m usually happy to answer questions), leave a comment below with your specific use case, and I’ll try to help!
All the best,
Pim