This page contains instructions on how to build your Unity application for Android and considerations to be aware of when you do. For information on the build process for Android and the tools Unity uses, refer to How Unity builds Android applications.
Instead of building your application, you can also export the Unity project as a Gradle project and import that into Android Studio. This is useful if you want more control over the build pipeline, want to see or modify the Android App Manifest that Unity generates for your application, or integrate Unity-powered features into another Android application. For more information, refer to Exporting an Android project.
Some digital distribution services that host Android applications have particular requirements that can change the build process. For example, Google Play requires your application to be an Android App Bundle (AAB) and not an APK. If you are targeting a specific digital distribution service with your build, refer to the documentation for that Digital distribution service first to check if the requirements differ.
Some digital distribution services have a limit on the initial install size of your application. Unity includes multiple methods that you can use to optimize the install size. For more information, refer to Optimize distribution size.
デバッグ目的でアプリケーションをビルドする場合は、アプリケーションにパッチを適用することで、ビルドに掛かる時間を短縮できます。詳細は アプリケーションへのパッチ適用 を参照してください。
ビルドを作成する前に、希望のランタイム設定およびビルドシステムプロパティでアプリケーションがビルドされるように、プロジェクトの設定を行ってください。Unity ビルドの設定は、以下の 2 つの設定セットによって構成されます。
Unity は、以下の公開形式で Android アプリケーションをビルドすることができます。
デフォルトでは Unity は APK 公開形式で Android アプリケーションをビルドします。AAB としてAndroid アプリケーションをビルドするための設定は、以下の手順で行えます。
Android 用に Unity アプリケーションをビルドするには、以下を行ってください。
Build and Run を選択すると、Unity はビルド作成時に以下を実行します。
ヒント: 出力パスの初回指定後は、Ctrl+B (macOS では Cmd+B) のキーボードショートカットでアプリケーションをビルドして実行 (Build and Run) できます。
Android アプリケーションを Android 端末で実行するには、デジタル署名が必要です。アプリケーションへの署名には、以下の 2 種類があります。
カスタム署名情報を提供するには、キーストアを作成 し、それを Publishing Settings 内に読み込んでください。
カスタム署名情報が提供された際、Unity はセキュリティ上の理由から、キーストアとキーパスワードをディスクに保存しません。つまり、Unity エディターを再起動するたびにキーパスワードを再入力する必要があります。パスワードを入力せずにアプリケーションをビルドしようとすると、ビルドプロセスが失敗します。Unity エディターを開くたびにパスワードを入力しなくて済むようにするには、公開用のアプリケーションをビルドする時にだけカスタム署名情報を提供するのがベストプラクティスです。デバイス上でテストするためのビルドを作成する場合にはカスタム署名情報を提供せず、代わりにデバッグ署名を使用します。
アプリケーションへの署名に関する詳細は、アプリへの署名 を参照してください。
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.