I’m trying to build Unity project in Xcode, it is a simple 2D project of games like Crossword,Trivia, MCQ questions… when i archive and download from Testflight the game is 2GB in size, any idea what to do or why is it so big ?
Question posted in Xcode
Whether you're new to Xcode or an experienced developer, our archive has everything you need to know about this integrated development environment (IDE). From basic functionalities to advanced features, our archive covers a wide range of Xcode-related questions and answers. Browse our archive now and find solutions to your Xcode questions, and take your app development skills to the next level
Whether you're new to Xcode or an experienced developer, our archive has everything you need to know about this integrated development environment (IDE). From basic functionalities to advanced features, our archive covers a wide range of Xcode-related questions and answers. Browse our archive now and find solutions to your Xcode questions, and take your app development skills to the next level
2
Answers
as @MickyD explained a lot of stuff that would help, however the problem was with the assets "sprites" imported were too big, so since I had like 3k sprites, i couldn't re-import each one of them as a POT so I compressed them inside Unity by overriding for IOS
and if the sprite lost a lot of quality I would increase the size to 2048 or try another format.
NOTE: Avoid using LZMA compression since Asset Bundles "…results in smaller compressed Asset Bundles but they must be entirely decompressed before use.", Unity.
Sizing
Accurate size?
You can’t just look at the archive/bundle or files downloaded from TestFlight as a means to determine the app’s size because the binaries produced during these development/testing scenarios include additional files (e.g. DSYM) that won’t be present in it’s final form thus skewing the results.1
Apple has this to say on the subject (my emphasis):
Also don’t worry too much about TestFlight as builds are still going to be larger than what appears in the AppStore.1
Additionally, assuming you app gets approved, Apple will modify your submission including adding DRM and re-compressing everything. So you might have to wait to see the final size.1
How to get more accurate size information?
I think the best approach is to produce a App Size Report. Apple’s website has instructions for creating the most accurate file size report for download and installation sizes.2
Here’s an example (courtesy Apple):2
OP:
As above, development/testing outputs are not indicative of the final size on the Apple Store.
Unity folder size
OP:
By "project folder", I’m assuming you mean your project’s top-level folder in which Unity folders such as Assets, Packages and ProjectSettings exist. In any event, getting the size of the Unity project folder isn’t helpful for essentially the same reasons – it contains files that:
a) aren’t necessarily deployed
b) may be temporary (Logs)
c) for Unity-use-only such as caching (Library)
The easiest way to get the size of your Unity project is to get the size of the Assets, Packages and ProjectSettings folders and the best time to do that is when performing a fresh check-out of your project from source control.
Remember, only the folders highlighted in green above should be added to source control and therefore are the candidates for determining your Unity project size.3
Trimming the fat
Chose a better compression option in Unity. This will compress assets, scenes and global illumination data.
For PROD you should be using LZ4HC which offers the best compression but is slower to build.
LZ4 is the next best compression and is faster to produce making it suitable for DEV builds.
The Default option in Unity doesn’t use any form of compression.
Check out App Thinning on Unity’s website. Since it’s a large topic, I can’t really do it justice by reproducing it here.
1 "Reducing Your App’s Size", Apple
2 Create the App Size Report
3 Using external version control systems with Unity, Unity