Optimize distribution size
Explains methods your can use to optimize your application installation size.
Read time 2 minutesLast updated 21 days ago
Some digital distribution services have a limit on the initial install size of your application. Unity includes the following methods to help you to optimize the install size:
Split APKs by target architecture
If your output application uses APK format, the Split APKs by target architecture Player Setting optimizes the application download and installation size. Instead of producing one APK that contains binaries for every target CPU architecture selected in the Target Architectures Player Setting, Unity creates a separate APK for each CPU architecture. You can upload this set of APKs to digital distribution services which serve the APK with the correct target CPU architecture to each device that downloads your application.
This is primarily a Google Play feature and may not work for other digital distribution services. For more information, see Multiple APK support.
Split the application binary
You can split your output application to make the initial install size smaller. The device can install a lighter version of your application and then download assets separately. If your output application uses APK format, Unity can split the application into a main APK and an expansion file (OBB). For more information see APK expansion files. If your output application uses AAB format, Unity can split the application into a base module and asset packs. For more information, see Play Asset Delivery.
To split the application binary:
- Select Edit > .Project Settings
?
- In the Project settings window, select the Player tab, then open Android Player Settings.
- In the Publishing Settings section, enable Split Application Binary.
Compression
You can change the method Unity uses to compress resource files for the application. This can reduce the size of the application but can increase loading times if the method means data takes longer to decompress.
For more information, see Compression Method.
Minification
You can use ProGuard minification to decrease the size of the application and improve performance.
To enable ProGuard minification:
- Select Edit > Project Settings.
- In the Project settings window, select the Player tab, then open Android Player Settings.
- In the Publishing Settings section, under Minify enable either Release, Debug, or both depending on the type of build you want to minify.
For more control over the minification process, generate a custom file and configure it to specify what not to strip. To generate the file, select Custom Proguard File in the Publishing Settings section. This generates the file in your project's folder. For information on how to configure ProGuard minification, see the ProGuard documentation.
proguard.txtproguard.txtAssets/Plugins/Android