デジタル配信サービスの中には、アプリケーションの初期インストールサイズに制限を設けているものがあります。Unity は、インストールサイズの最適化のために、以下の方法を提供しています。
出力アプリケーションが APK 形式を使用している場合は、Player 設定 の Split APKs by target architecture (ターゲットアーキテクチャごとの APK の分割) でアプリケーションのダウンロードおよびインストールサイズを最適化できます。Unity は、(Player 設定の Target Architectures で選択された全てのターゲット CPU アーキテクチャのバイナリを 1 つの APK に含めて作成するのではなく) CPU アーキテクチャごとに個別の APK を作成します。この APK 一式を デジタル配信サービス にアップロードすれば、アプリケーションをダウンロードする各デバイスに、正しいターゲット CPU アーキテクチャの APK が提供されます。
これは主に Google Play の機能であり、他のデジタル配信サービスでは機能しない可能性があります。詳細は 複数 APK サポート を参照してください。
ノート: Google Play では、新しいアプリケーションは APK ではなく AAB である必要があります。AAB をアップロードすると、Google Play が自動的に、各デバイスの設定に応じて最適化された APK を生成して提供します。
出力アプリケーションを分割することで、初期インストールサイズを小さくすることができます。デバイスは、より軽量なバージョンのアプリケーションをインストールしてから個別にアセットをダウンロードできます。出力アプリケーションが APK 形式を使用している場合は、Unity はアプリケーションを主要な APK と拡張ファイル (OBB) に分割できます。詳細は APK 拡張ファイル を参照してください。出力アプリケーションが AAB 形式を使用している場合は、Unity はアプリケーションを ベースモジュール とアセットパックに分割できます。詳細は Play Asset Delivery を参照してください。
アプリケーションバイナリの分割は、以下の手順で行えます。
Unity がアプリケーションのリソースファイルの圧縮に使用する方法を変更することができます。これによりアプリケーションのサイズの縮小が可能ですが、データの解凍時間が増大する圧縮方法の場合は、ロード時間が増大する可能性があります。
詳細は Compression Method を参照してください。
ProGuard で小型化を行うことで、アプリケーションのサイズを縮小し、パフォーマンスを向上させることができます。
ProGuard による小型化を有効にするには、以下を行ってください。
ノート: ProGuard はアプリケーションが必要とする重要なコードを削除する場合があるので、小型化する全てのビルドを検査してください。
最小化の処理をより詳細に制御するには、カスタム proguard.txt
ファイルを生成し、削除しないものを指定する設定を行います。このファイルを生成するには、Publishing Settings セクションで Custom Proguard File を選択してください。これにより、プロジェクトの Assets/Plugins/Android
フォルダーに proguard.txt
ファイルが生成されます。ProGuard の小型化の設定方法については ProGuard のドキュメント を参照してください。
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.