Skip to content

Instantly share code, notes, and snippets.

@creepteks
Last active May 20, 2021 11:15
Show Gist options
  • Save creepteks/cd1ba413d9484c86fdba1b1a34338a1d to your computer and use it in GitHub Desktop.
Save creepteks/cd1ba413d9484c86fdba1b1a34338a1d to your computer and use it in GitHub Desktop.
Reducing Unity release size
  1. Use a differnet compression when building. (ex. form LZ4 -> LZ4HC)
  2. Addressable: use compression for your asset groups, clean and rebuild groups before another build
  3. strip the dlls:
  • automatically :

You can change scripting backend in ProjectSettings -> Player -> Configuration to IL2CPP and in Optimiztion section set Managed Stripping Level to High. Tested it in Unity 2020.1.17f1 in Mobile template. Size reduced from 17Mb to 6Mb with empty scene only. Also trying step by @Pindwin but no result for me. https://stackoverflow.com/questions/64031576/unity-included-dlls-size

You can check your apk file like this: Android Studio -> Build -> Analyze APK https://stackoverflow.com/questions/53716498/unity3d-android-build-report-complete-size-too-large

Reducing mobile .NET library size https://stackoverflow.com/questions/51681967/how-to-reduce-unity-android-game-size

  • manual :

manually delete the dlls that you are absolutely sure do not affect the apk https://stackoverflow.com/questions/47247888/how-can-i-exclude-unnecessary-dlls-from-my-build

  1. Unity resources

https://docs.unity3d.com/Manual/ReducingFilesize.html

https://docs.unity3d.com/Manual/class-PlayerSettingsAndroid.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment