How to Reduce APK Size in Unity
How to Reduce APK Size in Unity — The Ultimate 2025 Optimization Guide
When you release a mobile game, every megabyte matters. A bloated build can turn away players, lower retention, and even stop downloads altogether. Luckily, Unity gives us many ways to cut APK and AAB file size without sacrificing quality. In this detailed guide, you’ll learn how to shrink your builds, step by step — from textures to code stripping.
๐ฆ Why APK Size Matters
Players often judge a game before they even install it. A 50 MB APK feels lightweight and quick; a 300 MB one can look intimidating. Google Play also enforces 100 MB limit for APKs (AABs are split, but still large files affect download time).
Smaller builds mean:
- ✅ Faster downloads and updates
- ✅ Lower data usage for players
- ✅ Better performance and startup time
- ✅ Easier debugging and submission
๐ฏ Step 1 — Audit Your Build
Before you optimize, you need to know what’s taking space. Go to Window → Analysis → Build Report (Unity 2021+), or install the free Build Report Inspector package.
This gives you a breakdown of textures, meshes, audio, scripts, and DLLs. Focus first on assets taking 70–80 % of total size — usually textures, audio, and shaders.
๐ผ️ Step 2 — Optimize Textures and Sprites
Textures are usually the biggest culprit. Follow these golden rules:
- Compress everything. Use ASTC or ETC2 for Android, PVRTC for iOS.
- Lower resolution on UI or background textures that don’t need 4K quality.
- Reuse atlases — combine multiple sprites into one sheet using Sprite Atlas.
- Turn off “Read/Write Enabled” in the Import Settings unless you modify the texture at runtime.
Pro tip: Keep UI sprites at 512 px or 1 k max. Players can’t tell the difference, but your APK will.
๐ Step 3 — Compress Audio
Sound files can eat tens of megabytes if left uncompressed.
- Convert WAV → OGG for music, MP3 for voice-overs.
- Lower bitrate to 96 kbps – 128 kbps for background music.
- Check Load Type: set to Streaming for long tracks, Decompress on Load for short SFX.
In the Audio Clip inspector, test quality vs. size trade-off before final build. You can easily reduce audio weight by 60 %.
๐งฐ Step 4 — Enable Code Stripping (IL2CPP)
Switch your scripting backend to IL2CPP instead of Mono. Then, under Player Settings → Publishing Settings, set Managed Stripping Level = Medium or High.
This removes unused methods, generic templates, and libraries from final binaries.
Example impact: A 25 MB Mono build can drop to 14–16 MB IL2CPP with High stripping level.
๐️ Step 5 — Split by Architecture
Instead of shipping both ARMv7 and ARM64 in one APK, let Play Store deliver the right one.
- Open Build Settings → Player Settings → Other Settings.
- Uncheck “Export as single APK”.
- Enable Split by Architecture.
Unity will build separate APKs for ARMv7 and ARM64 — smaller and faster to install.
๐ฎ Step 6 — Remove Unused Assets and Scenes
Biggest hidden problem: assets that are imported but never used.
- Go to Build Settings → Scenes In Build → uncheck unused ones.
- Use Tools → Project Auditor to find references to unused assets.
- Move test art, old prefabs, and dev scripts to a “Dev Only” folder outside Assets before building.
Even one forgotten music track or high-poly model can add 5 MB+.
๐งฉ Step 7 — Use Addressables for Dynamic Loading
Addressables let you keep heavy assets outside the main APK and download them only when needed. Example: levels 3–10 load after player finishes level 2.
using UnityEngine.AddressableAssets;
public class LevelLoader : MonoBehaviour
{
public AssetReferenceGameObject levelPrefab;
public void LoadLevel()
{
levelPrefab.InstantiateAsync();
}
}
Store addressable content on a CDN or Firebase Storage — and your APK installs instantly while assets stream later.
๐ป Step 8 — Compress Meshes and Animations
- Enable Mesh Compression (Import Settings → Model tab).
- Remove blend shapes and rigs for static props.
- Use simplified LOD (Level of Detail) models for distant objects.
- Set Animation Clips → Compression = Optimal.
These small optimizations can shave off multiple megabytes in large 3D projects.
๐งฎ Step 9 — Optimize Shaders and Materials
Shaders compile variants for each lighting and render path, creating massive builds if unchecked.
- Remove unused Shader Graph variants.
- Use
GraphicsSettings→ strip unused shader features. - Combine materials with shared textures to reduce draw calls and size.
Also test builds with “Development Build” unchecked — it adds debug symbols that inflate size by 10–15 %.
๐งน Step 10 — Clean Plugins and Packages
Third-party plugins and SDKs are infamous for hidden bloat. If you import analytics or ads packages, remove platforms you don’t use (e.g., iOS from Android build).
In Project window, open each plugin folder → delete unnecessary architecture libraries (.so files) and editor tools.
Pro tip: Use the Assembly Definition Files (.asmdef) feature to limit scripts to specific platforms — reduces compilation time and package size.
๐ง Bonus — Automate Size Testing
Use this quick script to print total build size after each build:
using UnityEditor;
using UnityEngine;
using System.IO;
public class BuildSizeLogger
{
[PostProcessBuild]
public static void LogSize(BuildTarget target, string path)
{
long bytes = new FileInfo(path).Length;
float mb = bytes / 1048576f;
Debug.Log($"Build Size: {mb:F2} MB");
}
}
Now you’ll see your build size after every export — perfect for tracking improvement as you apply optimizations.
๐ Real-World Results
Applying these steps on a 2D mobile platformer project reduced its APK from 98 MB to 41 MB — a 58 % reduction! Here’s where the savings came from:
- Textures → −30 MB (using ASTC + Atlases)
- Audio → −10 MB (OGG compression)
- Code → −6 MB (IL2CPP High Stripping)
- Addressables → −11 MB (deferred assets)
And the best part — game quality remained identical.
๐ Final Checklist
- ✅ Compress textures and audio
- ✅ Use IL2CPP and stripping
- ✅ Split architecture
- ✅ Remove unused assets and scenes
- ✅ Load heavy content via Addressables
- ✅ Clean plugins and packages
Run through this list before each release build — you’ll save space and impress your players with fast, polished installs.
๐ฌ Final Thoughts
Optimizing build size is not a one-time task — it’s a discipline. The more frequently you profile and trim, the healthier your project stays. When you treat every megabyte like gold, you deliver a better experience and reach a wider audience.
๐ฌ What’s your biggest APK optimization win? Share your experience in the comments and let’s help other Unity devs build smaller and smarter!

Comments
Post a Comment