Hello,
I’ve just finished my first iOS Unity app and released it to the appstore. It’s not a big project, and it’s not a big problem, but I’d like to see if I can reduce the app size to a minimum. Following advice I’ve found online I’ve looked at the build report to see a breakdown in build sizes and what my largest files were, and this is what I got:
Build Report
Uncompressed usage by category (Percentages based on user generated assets only):
Textures 20.3 mb 63.2%
Meshes 242.5 kb 0.7%
Animations 0.0 kb 0.0%
Sounds 9.6 kb 0.0%
Shaders 2.1 mb 6.7%
Other Assets 703.6 kb 2.1%
Levels 149.8 kb 0.5%
Scripts 194.7 kb 0.6%
Included DLLs 6.4 mb 20.0%
File headers 2.0 mb 6.1%
Total User Assets 32.1 mb 100.0%
Complete build size 699.4 mb
Used Assets and files from the Resources folder, sorted by uncompressed size:
3.0 mb 0.4% Built-in Texture2D:
2.1 mb 0.3% Assets/UI Graphics/Launch title graphic@2x.png
1.6 mb 0.2% Packages/com.unity.render-pipelines.universal/Shaders/PostProcessing/UberPost.shader
As expected most of the space was Textures, 20.3MB, but what I didn’t expect was the three largest files: an unnamed Texture2D and my launch screen logo, followed by a post processing shader that I think should have been stripped since I don’t use any postprocessing. After looking online it seems that the graphics used in the launch screen (including the background that’s the unnamed Texture2D) are for some reason re-saved uncompressed in the build process, which is why they’re so big (the file “Launch title graphic@2x.png” is 47k in the Assets folder, and 2.1MB in the list above). Does anyone know if this is true, and if there’s any way to avoid this?
The other question this raised was if any of this matters, since the complete build size listed (699MB!) doesn’t really seem to reflect anything meaningful for the resulting app size. When packaging the app for the AppStore in XCode these things seem to be compressed(?) and stripped anyway and the build above resulted in a 54MB app package. So maybe the uncompressed launch screen graphics from the list above get compressed in this step anyway?
Still, 54MB is quite a lot for a simple app, and 22MB extra on top of the uncompressed assets and code listed above. This article (Unity - Manual: Optimizing the size of the built iOS Player) in the manual seems to indicate an empty Unity project should fit in a 12MB app on the AppStore.
So, does anyone have any tips for reducing the size of the finished iOS app package?