Google is committed to advancing racial equity for Black communities. See how.

Reduce game APK size

This guide describes how to reduce the size of a game APK. Upon installation, a smaller game APK requires less time to download and less data. Both of these lead to higher install conversions. Google research shows that a 6 MB increase in APK size results in a 1% decrease in install rate. Many developers move assets out from the APK to a content delivery network (CDN), but then incur costs both in hosting the CDN and in developing and maintaining the asset management system.

To reduce the size of a game APK, perform the following steps:

  1. Determine the baseline size of the APK and understand its structure.
  2. Search for assets and other files that can be reduced in size.
  3. Inspect the graphics textures and identify opportunities for optimization.
  4. Determine whether APK assets are better suited for another delivery system.
  5. Follow the general recommendations for assets.

Determine the baseline size of the APK and understand its structure

To familiarize yourself with the game, determine the amount of work required for any given optimization, and determine whether the game downloads additional assets, perform the following steps:

  1. Use a production (non-debug) build from the developer or the published APK.
  2. Record the size of the binary file either as delivered by the developer or, if the game has been published, on the game's Play Store page. For APK size, the most important factor is the amount of data a user must download to run the actual game.
  3. Install the game on a device and run it to the initial game menu. At this point, check the install size of the game as reported by Android (under Settings > Storage). Some games have a small initial install size, as this is the key number to optimize, but download additional data after install. Some games download multiple gigabytes of data after install.
  4. Some games download data only after you start playing them. You should play the game for a bit to determine how much additional data the game downloads for a typical user playing the game for the first time.

Search for assets and other files that can be reduced in size

This section describes how to reduce the size of files in an APK.

To reduce the size of files packaged directly into the APK, perform the following steps:

  1. Use the Android Studio APK Analyzer. In Android Studio, select File > Profile or debug APK and select your APK.
  2. Select the Assets folder. For each file, the raw file size and the percentage of the total download size are listed.
  3. Review the Assets folder and determine where the bulk of the APK's data is located. Determine whether there are any assets that take up an excessive amount of space (that is, greater than 1% of the total). In particular, look for the following:

    • Large image and video files (for example, PNG, JPEG, and mp4 files): These files are typically used in splash screens, backgrounds, and logos. These files are rarely used in most games and can be compressed further without affecting the user experience. Lossless PNG files are particularly large and are excellent candidates for compression.
    • Large font files (for example, TTF files): If you add emoji support, it can significantly increase the font file's size. If a font file is larger than a few hundred kilobytes, consider ways to reduce its size.
    • Duplicate audio file formats or versions that you can combine.
  4. If multiple Application Binary Interfaces (ABIs) are included in the APK, move to App Bundles or build multiple APKs.

  5. Determine the size of the binary shared object (.so) files. To inspect binary files to see whether there are things that might not need to be included, such as log files, you can use the Bloaty McBloatface tool. For more information about how to optimize the binary files, refer to compile flags and options.

  6. Review the Android manifest file for supported graphics formats. Determine whether there are multiple <supports-gl-texture> tags in the APK. If the game supports formats for multiple GPUs in one APK, then consider using Binomial's Basis Universal. This GPU texture compression system creates texture files in an intermediate format that can be quickly transcoded to the GPU.

Inspect the graphics textures and identify opportunities for optimization

This section describes the tools and methods required to determine whether the graphics textures used in the game can be optimized.

To inspect the textures in the game, use the following tools:

Look for the following:

  • Textures that can be resized to a smaller resolution, such as a large texture for something that is only rendered at a small size in the game. Downsampling textures is computationally expensive.
  • Use of multiple small textures that can be combined into a single texture map.
  • Textures that can use fewer bits in the color channels. Good candidates are textures with a few, solid textures. Gradients and shades of color require more bits of resolution, and therefore aren't good candidates.
  • Explore better texture compression algorithms, from ETC1 to ETC2 and ASTC.
  • Discard the top mipmap level when loading the textures on lower end devices to save memory. Unity's Texture Streaming system can do this.

  • If you haven't already done so, review the Android manifest file for supported graphics formats. Determine whether there are multiple <supports-gl-texture> tags in the APK. If the game supports formats for multiple GPUs in one APK, then consider using Binomial's Basis Universal. This GPU texture compression system creates texture files in an intermediate format that can be quickly transcoded to the GPU.

Explore alternate delivery methods

Consider the following delivery methods:

  • To reduce installation size, use App Bundles with feature modules. App Bundles deliver an APK specific to each user's device configuration. On average, App Bundles reduce app size by 20%. Feature modules let a game download features and assets at some point after installation, so they don't need to be included as part of installation.

  • To make it so that game assets are served by Google Play, use Play Asset Delivery (PAD). No external CDN is required. PAD supports three distinct delivery methods, each of which can be used in a single game:

    • Install-time: Download assets upon installation. Assets are packaged in asset packs, which are a replacement for Opaque Binary Blob (OBB) files.
    • Fast-follow: Download assets after installation.
    • On-demand: The game initiates asset download as needed.

    PAD requires that games are packaged using the App Bundle format. PAD can also reduce the amount of data used by a developer's CDN (if one is still needed).

General recommendations for assets

Follow these recommendations for an APK's assets:

  • Image, audio, and video assets (not GPU textures): Determine whether the assets can be resized or compressed even further. Higher compression ratios are usually acceptable for games. Lossless PNG files are particularly large and are therefore excellent candidates for compression.
  • Image assets (not GPU textures): Consider using WEBP, an image compression format for both lossy and lossless compression. Lossy WEBP compresses images 25% to 34% more than JPG.
  • Reduce texture resolution: A texture much larger than the number of pixels that ultimately render on the screen is an inefficient use of space and GPU resources. To change a texture and see what it looks like in a frame without the need to rebuild the game, use GAPID.
  • Change graphics' texture formats: Use texture formats that use fewer bits per channel. For example, use a 16-bit texture format such as RGB565 instead of a 32-bit texture format such as ARGB. For more information, refer to the following:

Additional resources