Search code examples
iosxamarin.iostexture-atlassktextureatlasapp-thinning

How to reduce the size of iOS games and apps built in Xamarin.iOS?


The link to Apple Developer Guide is:

https://developer.apple.com/library/prerelease/content/documentation/LanguagesUtilities/Conceptual/iTunesConnect_Guide/Chapters/SubmittingTheApp.html

On that link, they have the section "Submitting the App for App Review", which has this message:

"Abnormally large build files are usually the result of storing data, such as images, inside the compiled binary itself instead of as a resource inside your app bundle. If you are compiling an image or large dataset into your binary, it would be best to split this data out into a resource that is loaded dynamically by your app. "

The total size of PNG images used by my game is about 130 Mb. When I compile and load the game onto my iPad for testing, I can see that the total size of the game is about 190 MB as shown on the iPad.

I already put the PNG images inside the folder "resource" in Xamarin studio, and my code builds those images into texture atlases before I compile and build my game.

So, per Apple's suggestion "it would be best to split this data out into a resource that is loaded dynamically by your app" in the message above, my questions are as follow:

(1) Can I further reduce the size of my game by "putting the images into another resource that can be dynamically loaded by my game" ? (Or will "App Thinning" help in this case ?)

(2) If the answer to question (1) above is "YES", would you please show me how to do that ? Or could you please send me a link to Xamarin website that shows us how to do that ?

Thank you very much.


Solution

  • I am not entirely sure as the docs aren't so clear. There are a lot of ways to reduce the size, though. For instance, you may use On Demand Resources, also a technique you can use for Apple devices.

    I included some links to some other topics that may be in your interest. For example: do you really need to build for all Apple platforms (arv6,7,x86_x64...)? That and more can be found in the links below.

    It partly boils down to your use cases and user base and so on, but you can use App Thinning with Xamarin

    Reducing Executable Size

    Use the linker to remove unnecessary code

    Apple's On Demand Resources

    Multiple architectures?