Version: 2021.3
言語: 日本語
Android 用の環境設定
Android キーストア

Android Player 設定

This page details the Player Settings for the Android platform. For a description of the general Player settings, see Player Settings.

Android の Player 設定
Android の Player 設定

プロパティのドキュメントは、Player UI のそれぞれのセクションに応じてグループ化されています。

Icon

Icon セクションを使用して、デバイスでアプリケーションを表現するアイコンを指定します。

Android のアイコン設定](../uploads/Main/PlayerSetAndroidIcon.png)

設定 説明 
Adaptive Android 8.0(API レベル 26)以上を搭載するデバイスでアプリケーションを表現する、さまざまなサイズのテクスチャを指定します。
Round Android 7.1(API レベル 25)以上を搭載するデバイスでアプリケーションを表現する、さまざまなサイズのテクスチャを指定します。
Legacy Android 7.1 (APIレベル 25)より前のバージョンを搭載するデバイスでアプリケーションを表現する、さまざまなサイズのテクスチャを指定します。

Resolution and Presentation

Resolution and Presentation (解像度と表示) セクションを使用して、画面の表示をカスタム化します。

Android の Resolution and Presentation 設定
Android の Resolution and Presentation 設定
設定 説明 
Fullscreen Mode デバイス上のウィンドウの表示方法を指定します。起動時のデフォルトのウィンドウモードを設定します。
Fullscreen Window The application window fills the full-screen native resolution of the device. To fill the full-screen window, Unity scales the application contents. To match the aspect ratio of the output device, Unity might add black bars to the rendered output so the content doesn’t stretch. This process is called letterboxing.In this mode, the navigation bar is always hidden.
Windowed このアプリケーションは、標準の、全画面表示ではない、移動可能な画面を使用します。画面サイズはアプリケーションの解像度に依存します。このモードでは、画面はデフォルトでサイズ変更可能です。これを無効にするには、Resizable Window を無効にします。
Resizable Window ユーザーがアプリケーションのウィンドウサイズを変更できるがどうかを示します。
この設定にすると、Android の携帯電話やタブレットで、アプリケーションのマルチウィンドウ機能が有効になります。詳しくは、Google の開発者向けドキュメント を参照してください。
Default Window Width アプリケーション画面のデフォルトの幅 (ピクセル単位)。このオプションは、Fullscreen ModeWindowed に設定されている場合にのみ使用できます。
Default Window Height アプリケーション画面のデフォルトの高さ (ピクセル単位)。このオプションは、Fullscreen ModeWindowed に設定されている場合にのみ使用できます。
Minimum Window Width アプリケーション画面の最小幅 (ピクセル単位)。このオプションは、Fullscreen ModeWindowed に設定されている場合にのみ使用できます。
Minimum Window Height アプリケーション画面の最小の高さ (ピクセル単位)。このオプションは、Fullscreen ModeWindowed に設定されている場合にのみ使用できます。
Hide Navigation Bar ウィンドウの上部に表示されるナビゲーションバーを非表示にするかどうかを示します。
Render outside safe area ノッチのあるディスプレイの領域を含め、アプリケーションがレンダリングに利用可能なすべての画面スペースを使用するかどうかを示します。 詳細については、Android の ディスプレイ カットアウトのサポート のドキュメントを参照してください。
Optimized Frame Pacing Unity がフレームレートのばらつきを少なくするために、フレームを均等に供給するかどうかを示します。このオプションを有効にすると、よりスムーズな体験が可能になります。

その他の Resolution and Presentation 設定は、以下のセクションにグループ化されています。

Resolution Scaling

画面解像度のスケーリングに関する設定をカスタマイズするには、Resolution Scaling セクションを使用します。デバイスのネイティブ解像度よりも低い解像度を使用すると、パフォーマンスとバッテリー寿命が向上します。

Android の Resolution Scaling 設定
Android の Resolution Scaling 設定
設定 説明 
Resolution Scaling Mode アプリケーションの解像度をスケールするかどうか、またその方法を指定します。スケーリングは、ネイティブの画面解像度と同等またはそれ以下に設定できます。低い解像度を使用すると、パフォーマンスとバッテリー寿命が向上します。
Disabled 解像度スケーリングを適用せず、アプリケーションはデバイスのネイティブ画面解像度でレンダリングします。
FixedDPI Applies resolution scaling using a target API. Use this to optimize performance and battery life or target a specific DPI setting.
Target DPI アプリケーションの解像度。デバイスのネイティブスクリーン DPI がこの値より高い場合、Unity はこの設定に合わせてアプリケーションの解像度をダウンスケールします。スケールを計算するには、Unity は以下を使います。
min(Target DPI * Factor / Screen DPI, 1)
ここで FactorQuality settingsResolution Scaling Fixed DPI Factor です。ノート: このオプションは、Resolution Scaling ModeFixed DPI に設定した場合のみ表示されます。
Reset resolution on window resize ネイティブウィンドウサイズが変更されたときに、画面解像度を新しいネイティブウィンドウサイズに設定するかどうかを指定します。 Resolution Scaling ModeFixed DPI に設定すると、Unity は Fixed DPI プロパティに基づき解像度を再計算します。
Blit Type 最終的な画像を画面にレンダリングする際に、blit を使用するかどうかを制御します。blit の使用はほとんどのデバイスと互換性がありますが、通常、blit を使用しない場合よりも速度が低下します。
Always Unity はオフスクリーンバッファにレンダリングし、次に blit を使用してバッファのコンテンツをデバイスのフレームバッファにコピーします。これはほとんどのデバイスと互換性がありますが、通常、blit を使用しない場合よりも速度が低下します。
Never Unityは、デバイスのオペレーティングシステムが提供するフレームバッファにレンダリングします。これが失敗すると、アプリケーションはデバイスログに 1 回限りの警告を出力します。これは通常、blit を使用するよりも高速ですが、すべてのデバイスと互換性があるわけではありません。
Auto Unity は、可能であればデバイスのオペレーティングシステムが提供するフレームバッファにレンダリングします。これが失敗した場合、Unity はデバイスコンソールに警告を出力し、blit を使用して最終的な画像を画面にレンダリングします。

Supported Aspect Ratio

Supported Aspect Ratio セクションを使用して、サポートするデバイスのアスペクト比に関する設定をカスタマイズします。

Android の Resolution Scaling 設定
Android の Resolution Scaling 設定
設定 説明 
Aspect Ratio Mode アプリケーションがサポートする最大アスペクト比を指定します。デバイスのアスペクト比がこのアスペクト比より大きい場合、Unity はアプリケーションにこのアスペクト比を使用し、アプリケーションが引き伸ばされないように黒帯を追加します。
Legacy Wide Screen (1.86) このアプリケーションは、Android の従来のワイドスクリーンアスペクト比までをサポートします。
Native Aspect Ratio このアプリケーションは、Android のネイティブのアスペクト比までをサポートします。
Custom このアプリケーションは、Up To で設定したアスペクト比までをサポートします。
  Up To カスタムの最大アスペクト比。

この設定は、Aspect Ratio ModeCustom に設定したときのみ表示されます。

Orientation

Orientation セクションを使用して、デバイス上のアプリケーションの向きに関連する設定をカスタマイ ズすることができます。

Android の Orientation 設定
Android の Orientation 設定

Default Orientation ドロップダウンからゲームの画面の向きを選択します。

設定 説明 
Default Orientation アプリケーションが使用する画面の向きを指定します。

ノート: Unity は、この設定に設定した値を Android と iOS で共有します。
Portrait このアプリケーションは、アプリケーションのウィンドウの下部がデバイスの画面の下部に一致する縦向き画面を使用します。
Portrait Upside Down このアプリケーションは、アプリケーションのウィンドウの下部とデバイスの画面の上部が一致する縦向き画面を使用します。
Landscape Right このアプリケーションは、アプリケーションのウィンドウの右側がデバイスの画面の下部に位置する横向き画面を使用します。
Landscape Left このアプリケーションは、アプリケーションのウィンドウの右側がデバイスの画面の上部に位置する横向き画面を使用します。
Auto Rotation 画面は、自動回転に使用できる向き で指定した向きに回転できます。

Allowed Orientations for Auto Rotation

Allowed Orientations for Auto Rotation セクションを使用して、 Default Orientation から Auto Rotation を設定するときにアプリケーションがサポートする方向を指定します。これは、例えば、アプリケーションを横向きのままして、ユーザーが横向きの左と右を切り替えられるようにする場合に便利です。

このセクションは Default OrientationAuto Rotation に設定されている場合にのみ表示されます。

Android の Auto Rotation 設定での可能な向き
Android の Auto Rotation 設定での可能な向き
設定 説明 
Portrait アプリケーションが、アプリケーションウィンドウの下部がデバイスの画面の下部と揃う縦向きの画面をサポートするかどうかを示します。
Portrait Upside Down アプリケーションが、アプリケーションウィンドウの下部がデバイスの画面の上部と揃う縦向きの画面をサポートするかどうかを示します。
Landscape Right アプリケーションが、アプリケーションウィンドウの右側がデバイスの画面の底部と揃う横向きの画面をサポートするかどうかを示します。
Landscape Left アプリケーションが、アプリケーションウィンドウの右側がデバイスの画面の上部と揃う横向きの画面をサポートするかどうかを示します。

Other

Resolution and Presentation セクションには、以下の一般設定も含まれます。

Android のその他の解像度と表示の設定
Android のその他の解像度と表示の設定
設定 説明 
Use 32-bit Display Buffer ディスプレイバッファが 16 ビットカラー値ではなく 32 ビットカラー値を保持するかどうかを示します。バンディングが発生したり、ポストプロセスエフェクト でアルファ値が必要な場合は、この設定を有効にします。ポストプロセスエフェクトの中には、ディスプレイバッファと同じ形式で レンダーテクスチャ を作成するものがあるため、この設定が必要です。
Disable Depth and Stencil 深度バッファとステンシルバッファを無効にするかどうかを示します。
Render Over Native UI Android または iOS で、ネイティブ UI の上にレンダリングするかどうかを示します。この設定を有効にするには、Camera の Clear Flags を設定して、アルファ値が 1 より低いソリッドカラーを使用するようにします。
Show Loading Indicator ローディングインジケーターを表示するかどうか、またどのように表示するかを指定します。
Don’t Show ローディングインジケーターを表示しません。
Large 大きなローディングインジケーターを表示します。
Inversed Large 大きなローディングインジケーターを反転色で表示します。
Small 小さなローディングインジケーターを表示します。
Inversed Small 小さなローディングインジケーターを反転色で表示します。

Splash Image

Virtual Reality Splash Image 設定を使用して、VR ディスプレイのカスタムスプラッシュ画像を指定します。一般的なスプラッシュスクリーン の設定については、スプラッシュスクリーン を参照してください。

VR のスプラッシュ設定
VR のスプラッシュ設定

一般的な Splash Screen 設定の下で、Android 特有の Static Splash Image を設定できます。

Android のスプラッシュスクリーン設定
Android のスプラッシュスクリーン設定
設定 説明 
Image Android のスプラッシュスクリーンとしてアプリケーションが使用するテクスチャを指定します。スプラッシュスクリーン用画像の標準的なサイズは 320x480 です。
Scaling Specifies how to scale the splash image to fit the devic’es screen.
Center (only scale down 画像が大きすぎる場合を除き、ネイティブの大きさで描画します。画像が大きすぎ場合は、Unity が画像が収まるように縮小します。
Scale to Fit (letter-boxed) 画像の縦横どちらか長い方が画面サイズにぴったり合うように描画します。短辺側の空きスペースは、黒で塗りつぶされます。
Scale to Fill (cropped) 画像を縦横どちらか短い方が画面サイズにぴったり合うようにスケールします。長辺側の画面におさまらない部分はクロップされます。

Other Settings

Other Settings のセクションでは、以下のグループに分類されたさまざまなオプションをカスタマイズできます。

Rendering

これらの設定を使用して、Android プラットフォーム向けにゲームをレンダリングする方法をカスタマイズします。

Android プラットフォームのレンダリング設定
Android プラットフォームのレンダリング設定
Property Description
Color Space Choose which color space Unity uses for rendering: Gamma or Linear. See the Linear rendering overview for an explanation of the difference between the two.
Gamma: Gamma color space is typically used for calculating lighting on older hardware restricted to 8 bits per channel for the framebuffer format. Even though monitors today are digital, they might still take a gamma-encoded signal as input.
Linear: Linear color space rendering gives more precise results. When you select to work in linear color space, the Editor defaults to using sRGB sampling. If your Textures are in linear color space, you need to work in linear color space and disable sRGB sampling for each Texture.
Auto Graphics API Disable this option to manually pick and reorder the graphics APIs. By default this option is enabled, and Unity tries to use Vulkan. If the device doesn’t support Vulkan, Unity falls back to GLES3.2, GLES3.1 or GLES3.0. There are three additional checkboxes to configure the minimum OpenGL ES 3.x minor version: Require ES3.1, Require ES3.1+AEP and Require ES3.2.
Important: Unity adds the GLES3/GLES3.1/AEP/3.2 requirement to your Android App Manifest only if GLES2 is not in the list of APIs when Auto Graphics API is disabled. In this case only, your application does not appear on unsupported devices in the Google Play Store.
Color Gamut You can add or remove color gamuts for the Android platform to use for rendering. Click the plus (+) icon to see a list of available gamuts. A color gamut defines a possible range of colors available for a given device (such as a monitor or screen). The sRGB gamut is the default (and required) gamut. When targeting devices with wide color gamut displays, use DisplayP3 to utilize full display capabilities.
Multithreaded Rendering Enable this option to move graphics API calls from Unity�s main thread to a separate worker thread. This can help to improve performance in applications that have high CPU usage on the main thread.
Static Batching Enable this option to use Static batching.
Dynamic Batching Enable this option to use Dynamic Batching on your build (enabled by default).
Note: Dynamic batching has no effect when a Scriptable Render Pipeline is active, so this setting is only visible when nothing is set in the Scriptable Render Pipeline Asset Graphics setting.
Compute Skinning Enable this option to enable DX11/ES3 GPU compute skinning, freeing up CPU resources.
Graphics Jobs Enable this option to instruct Unity to offload graphics tasks (render loops) to worker threads running on other CPU cores. This is intended to reduce the time spent in Camera.Render on the main thread, which is often a bottleneck.
Texture compression format Choose between ASTC, ETC2 and ETC (ETC1 for RGB, ETC2 for RGBA). See texture compression format overview for more information on how to pick the right format.
See Texture compression settings for more details on how this interacts with the texture compression setting in the Build Settings.
Normal Map Encoding Choose XYZ or DXT5nm-style to set the normal map encoding. This affects the encoding scheme and compression format used for normal maps. DXT5nm-style normal maps are of higher quality, but more expensive to decode in shaders.
Lightmap Encoding Choose Normal Quality or High Quality to set the lightmap encoding. This setting affects the encoding scheme and compression format of the lightmaps.
Lightmap Streaming Whether to use Mipmap Streaming for lightmaps. Unity applies this setting to all lightmaps when it generates them.
Note: To use this setting, you must enable the Texture Streaming Quality setting.
  Streaming Priority Set the priority for all lightmaps in the Mipmap Streaming system. Unity applies this setting to all lightmaps when it generates them.
Positive numbers give higher priority. Valid values range from –128 to 127.
Frame Timing Stats Enable this property to gather CPU and GPU frame time statistics. Use this together with the Dynamic Resolution camera setting to determine if your application is CPU or GPU bound.
Virtual Texturing Indicates whether to enable Virtual Texturing.
Note: Virtual Texturing isn’t compatible with Android.
Shader precision model Controls the default precision of samplers used in shaders. See Shader data types and precision for more details.
360 Stereo Capture Unity がステレオスコピック 360 の画像やビデオをキャプチャできるようにするか指定します。詳細は Stereo 360 Image and Video Capture を参照してください。
ノート: 360 ステレオスコピックキャプチャリングは Android と互換性がありません。

Vulkan Settings

Android プラットフォームの Vulkan 設定
Android プラットフォームの Vulkan 設定
プロパティ 物件概要
SRGB Write Mode このオプションを有効にすると、Graphics.SetSRGBWrite() レンダラーが、ランタイム中に sRGB 書き込みモードを切り替えられるようになります。つまり、リニアから sRGB への書き込み色変換を一時的にオフにしたい場合は、このプロパティを使用してそれを行えます。有効にした場合、モバイルのタイルベース GPU のパフォーマンスに悪影響を与えるので、モバイルでは有効にしないでください。
Number of swapchain buffers このオプションを 2 に設定するとダブルバッファリング、3 に設定するとトリプルバッファリングが、Vulkan レンダラーに使用されます。この設定は、一部のプラットフォームでは待ち時間の改善に役立つ場合がありますが、ほとんどの場合はデフォルト値の 3 のままにすることが推奨されます。ダブルバッファリングはパフォーマンスに悪影響を及ぼす可能性があります。Android ではこの設定は使用しないでください。
Acquire swapchain image late as possible 有効にすると、Vulkan は、バックバッファの取得を遅らせ、フレームをオフスクリーン画像にレンダリングした後でそれを行います。Vulkan は、ステージング画像を使用してこれを行います。この設定を有効にすると、バックバッファを表示する時に Blit が 1 つ追加で発生します。この設定とダブルバッファリングを組み合わせることで、パフォーマンスを向上させることができます。ただし、追加の Blit が帯域幅を使用するため、パフォーマンスの問題を引き起こす可能性もあります。
Recycle command buffers Unity が CommandBuffers を実行した後に、それを再利用するか解放するか指定します。
Apply display rotation during rendering Enable this to perform all rendering in the native orientation of the display. This has a performance benefit on many devices. For more information, see documentation on Vulkan swapchain pre-rotation.

Identification

Android プラットフォームの ID 設定
Android プラットフォームの ID 設定
プロパティ 機能
Override Default Package Name アプリケーションのデフォルトのパッケージ名をオーバーライドするかどうかを示します。
ノート: この設定は、macOS、iOS、tvOS、Android に影響します。
  Package Name Set the application ID, which uniquely identifies your app on the device and in Google Play Store. The application ID must follow the convention com.YourCompanyName.YourProductName and must contain only alphanumeric and underscore characters. Each segment must start with an alphabetical character. For more information, see Set the application ID.
Important: Unity automatically removes any invalid characters you type.
To set this property, enable Override Default Package Name.
Version バンドルのイテレーション (リリースされたかどうかにかかわらず) を示す、バンドルのビルドバージョン番号を入力します。バージョンはドットで区切られた数字を含む一般的な文字列の形式 (4.3.2 など) で特定されます。これは iOS と Android 間で共有されます。
Bundle Version Code 内部バージョン番号。この数は、あるバージョンがもう 1 つのバージョンよりも新しいかを判断するためだけに使用されます。大きい数はより最近のバージョンであることを表します。これは、ユーザーに表示されるバージョン番号ではありません。その番号は、versionName 属性によって設定されます。値は、100 のような整数で設定する必要があります。ただし、後に続くバージョンに大きな数を与える限り、好きな数を決定できます。

例えば、ビルド番号も可能です。または、“x.y” 形式のバージョン番号を “x” と “y” を下位と上位の 16 ビットに別々にエンコードすることによって、整数に変換できます。

Split APKs by target architecture が有効になっている場合、この数を 100000 未満にしてください。各 APK には一意のバージョンコードが必要であるため、Unity は ARMv7 の数に 100000、ARM64 に 200000 を加えます。
Minimum API Level アプリケーションを実行するのに必要な API の最小バージョン (API レベル)
Target API Level アプリケーションをコンパイルするターゲットの Android バージョン (API レベル)

Configuration

Android プラットフォームの設定
Android プラットフォームの設定
Property Description
スクリプティングバックエンド 使用するスクリプティングバックエンドを選択します。スクリプトバックエンドは、Unity が Project 内の C# コードをどのようにコンパイルし、実行するかを決定します。
Mono Compiles C# code into .NET Common Intermediate Language (CIL) and executes that CIL using a Common Language Runtime. See the Mono Project website for more information.
IL2CPP Compiles C# code into CIL, converts the CIL to C++ and then compiles that C++ into native machine code, which executes directly at run time. See IL2CPP for more information.
API Compatibility Level Choose which .NET APIs you can use in your project. This setting can affect compatibility with 3rd-party libraries. However, it has no effect on Editor-specific code (code in an Editor directory, or within an Editor-specific Assembly Definition).
Tip: If you are having problems with a third-party assembly, you can try the suggestion in the API Compatibility Level section below.
.Net 2.0 .Net 2.0 libraries. Maximum .net compatibility, biggest file sizes. Part of the deprecated .NET 3.5 runtime.
.Net 2.0 Subset Subset of full .net compatibility, smaller file sizes. Part of the deprecated .NET 3.5 runtime.
.Net Standard 2.0 Compatible with .NET Standard 2.0. Produces smaller builds and has full cross-platform support.
.Net 4.x Compatible with the .NET Framework 4 (which includes everything in the .NET Standard 2.0 profile as well as additional APIs). Choose this option when using libraries that access APIs not included in .NET Standard 2.0. Produces larger builds and any additional APIs available are not necessarily supported on all platforms. See Referencing additional class library assemblies for more information.
C++ Compiler Configuration IL2CPP で生成されたコードのコンパイル時に使用する C++ コンパイラーの設定を選択します。
ノート: このプロパティは、 Scripting BackendIL2CPP に設定されている場合以外は無効になります。
Use incremental GC Enable this to use the incremental garbage collector, which spreads garbage collection over several frames to reduce gc-related spikes in frame duration.
Assembly Version Validation Indicates whether Mono validates types from a strongly-named assembly.
Mute Other Audio Sources Enable this option if you want your Unity application to stop Audio from applications running in the background. Otherwise, Audio from background applications continues to play alongside your Unity application.
Target Architectures Select which CPUs you want to allow the application to run on (32-bit ARM, 64-bit ARM, 32-bit x86, and 64-bit x86–64).
Note: Running Android apps in a 64-bit environment has performance benefits and 64-bit apps can address more than 4 GB of memory space.
Split APKs by target architecture (Experimental) Enable this option to create a separate APK for each CPU architecture selected in Target Architectures. This makes download size smaller for Google Play Store users. This is primarily a Google Play store feature and may not work in other stores. For more details, refer to Multiple APK Support.
Target Devices Specifies the target devices on which the APK is allowed to run.
All Devices The APK is allowed to run on all Android and Chrome OS devices.
Phones and Tablets Only The APK is allowed to run on Android phones and tablets, but not on Chrome OS devices.
Chrome OS Devices Only The APK is allowed to run on Chrome OS devices, but not on Android phones or tablets.
Install Location Specifies application install location on the device (for detailed information, refer to Android Developer documentation on install locations.
Automatic Let the operating system decide. User will be able to move the app back and forth.
Prefer External Install the application to external storage (SD card) if possible. The operating system doesn’t guarantee it; if not possible, the app will be installed to internal memory.
Force Internal Force the application to be installed to internal memory. The user will be unable to move the app to external storage.
Internet Access Choose whether to always add the networking (INTERNET) permission to the Android App Manifest, even if you are not using any networking APIs. Set to Require by default for development builds.
Auto Only add the internet access permission if you are using a networking API.
Require Always add the internet access permission.
Write Permission Choose whether to enable write access to the external storage (such as the SD card) and add a corresponding permission to the Android App Manifest. Set to External(SDCard) by default for development builds.
Internal Only grant write permission to internal storage.
External(SDCard) Enable write permission to external storage.
Filter Touches When Obscured Enable this option to discard touches received when another visible window is covering the Unity application. This is to prevent tapjacking.
Sustained Performance Mode Enable this option to set a predictable and consistent level of device performance over longer periods of time, without thermal throttling. Overall performance might be lower when this setting is enabled. Based on the Android Sustained Performance API.
Maximum Java Heap Size Set the maximum Java heap size to user for building (in megabytes). Defaults to 4096.
Low Accuracy Location Enable this option to use low accuracy values with Android location APIs instead.
Chrome OS Input Emulation Chrome OS’s default behaviour is to convert mouse and touchpad input events into touchscreen input events. Un-check this setting to disable the default behavior.
Android TV Compatibility Enable this option to mark the application as Android TV compatible.
  Android Game Enable this option to mark the output package (APK) as a game rather than a regular application.
  Android Gamepad Support Level Choose the level of support your application offers for a gamepad. The options are Works with D-Pad, Supports Gamepad, and Requires Gamepad.
Warn about App Bundle size Enable this option to receive a warning when the size of the Android App Bundle exceeds a certain threshold. This option is selected by default and you can only configure it if you enable the Build App Bundle (Google Play) option in the Build settings.
  App Bundle size threshold Enter a size in Mb. When your App Bundle exceeds this size, Unity will display a warning.
Active Input Handling Choose how you want to handle input from users.
Input Manager (old) Use the default Input window.
Input System (Preview) Use the newer Input system. The Input System is provided as a preview package for this release. To try a preview of the Input System, install the InputSystem package.
Both Use both systems side by side.

API Compatibility Level

すべてのターゲットに対する Mono の API Compatibility Level (API 互換性レベル) を選択できます。時にはサードパーティ製の .NET ライブラリが、.NET 互換性レベル外の機能を使用することがあります。そのような場合に何が起きているか理解し、最良の修正処理を行うためには、以下を試みると良いでしょう。

  1. Windows 用 ILSpy をインストールします。
  2. 問題のある API 互換性レベルの .NET アセンブリを ILSpy にドラッグします。これらは Frameworks/Mono/lib/mono/YOURSUBSET/ の下にあります。
  3. サードパーティ製のアセンブリをドラッグします。
  4. サードパーティ製のアセンブリを右クリックし、Analyze を選択します。
  5. 分析レポートの中で、Depends on セクションを調べます。サードパーティ製品依存でありながら、選択した .NET 互換性レベルで対応しないものはすべてここで赤字でハイライトされます。

Script Compilation

Android プラットフォームのスクリプトコンパイル設定
Android プラットフォームのスクリプトコンパイル設定
Setting Function
Scripting Define Symbols Set custom compilation flags. For more details, see the documentation on Platform dependent compilation.
Additional Compiler Arguments Add entries to this list to pass additional arguments to the Roslyn compiler. Use one new entry for each additional argument.
To create a new entry, press the ‘+’ button. To remove an entry, press the ‘-’ button.
When you have added all desired arguments, click the Apply button to include your additional arguments in future compilations.The Revert button resets this list to the most recent applied state.
Suppress Common Warnings Disable this setting to display the C# warnings CS0169 and CS0649.
Allow ‘unsafe’ Code Enable support for compiling ‘unsafe’ C# code in a pre-defined assembly (for example, Assembly-CSharp.dll).
For Assembly Definition Files (.asmdef), click on one of your .asmdef files and enable the option in the Inspector window that appears.
Use Deterministic Compilation Disable this setting to prevent compilation with the -deterministic C# flag. With this setting enabled, compiled assemblies are byte-for-byte identical each time they are compiled.
For more information, see Microsoft’s deterministic compiler option documentation.
Enable Roslyn Analyzers Disable this setting to compile user-written scripts without Roslyn analyzer DLLs that might be present in your project.
Use Roslyn Reference Assemblies Disable this setting to the compiler not to skip compilation reference assemblies when the metadata of the assembly does not change.

Optimization

Android プラットフォームの最適化設定
Android プラットフォームの最適化設定
プロパティ 物件概要
Prebake Collision Meshes Enable this option to add collision data to Meshes at build time.
Keep Loaded Shaders Alive When enabled, you cannot unload a shader. See Shader Loading for more information.
Preloaded Assets Set an array of Assets for the player to load on startup.
To add new Assets, increase the value of the Size property, then set a reference to the Asset to load in the new Element box that appears.
AOT compilation options Additional options for Ahead of Time (AOT) compilation. This helps optimize the size of the built iOS player.
Strip Engine Code Enable this option if you want the Unity Linker tool to remove code for Unity Engine features that your Project doesn’t use. This setting is only available with the IL2CPP scripting backend.

Most apps don’t use every available DLL. This option strips out DLLs that your app doesn’t use to reduce the size of the built Player. If your app is using one or more classes that would normally be stripped out under your current settings, Unity displays a debug message when you try to build the app.
Managed Stripping Level Choose how Unity strips unused managed (C#) code.The options are Disabled Low, Medium, and High.

When Unity builds your app, the Unity Linker process can strip unused code from the managed DLLs your Project uses. Stripping code can make the resulting executable significantly smaller, but can sometimes accidentally remove code that is in use. For more information about these options, see documentation on Managed code stripping.

For information about bytecode stripping with IL2CPP, see documentation on Managed bytecode stripping with IL2CPP.
Enable Internal profiler (Deprecated) Enable this option to get the profiler data from your device in the Android SDK’s adblogcat output while testing your projects. This is only available in development builds.
Vertex Compression Choose the channel that you want to set for compressing meshes under the vertex compression method, which by default, is set to Mixed. This affects all the meshes in your project. Typically, Vertex Compression is used to reduce the size of mesh data in memory, reduce file size, and improve GPU performance. For information on how to configure vertex compression and limitations of this setting, see [compressing meshes].
Optimize Mesh Data Selecting this option enables stripping of unused vertex attributes from the mesh used in a build.
This reduces the amount of data in the mesh, which might help reduce build size, loading times, and runtime memory usage. However, you must remember to not change material or shader settings at runtime, if you have this setting enabled. See PlayerSettings.stripUnusedMeshComponents for more information.
Texture MipMap Stripping Enable this option to enable mipmap stripping for all platforms, which strips unused mipmaps from Textures at build time. Unity determines unused mipmaps by comparing the value of the mipmap against the Quality Settings for the current platform. If a mipmap value is excluded from every Quality Setting for the current platform, then Unity strips those mipmaps from the build at build time. If QualitySettings.masterTextureLimit is set to a mipmap value that has been stripped, Unity will set the value to the closest mipmap value that has not been stripped.

Logging

特定のコンテキストで許可するログのタイプを選択します。

Androidプラットフォームのログ設定
Androidプラットフォームのログ設定
  • Select your preferred logging method from the available options.

  • Check a box that corresponds to each Log Type (Error, Assert, Warning, Log, and Exception) based on the type of logging you require. For example:
    • ScriptOnly: Logs only when running scripts.
    • Full: Logs all the time.
    • None: No logs are ever recorded.

    詳しくは、スタックトレースロギング を参照してください。

Legacy

Clamp BlendShapes (Deprecated) オプションを有効にすると、SkinnedMeshRenderers でブレンドシェイプのウェイトの範囲を固定できます。

Android プラットフォームの Legacy (古い) 設定
Android プラットフォームの Legacy (古い) 設定

Publishing Settings

Publishing Settings を使って、Unity が Android アプリケーションをビルドする方法を設定します。 Publishing 設定を開くには、Edit > Project Settings に移動し、Player を選択し、Android アイコンを選択し、Publishing Settings パネルを開きます。

このセクションでは、Publishing Settings パネルの各部分とその機能について説明します。以下の内容が含まれます。

Android publishing panel
Android publishing panel

ノート: セキュリティ上の理由から、Unity は Keystore や Project Key のパスワードを保存しません。

Keystore Manager ウィンドウを使用して、キーとキーストアを作成、構成、およびロードします。 KeystoreManager またはメインの Android Publishing パネルから、既存のキーストアとキーをロードすることができます。Keystore Manager からこれらをロードすることを選択する場合、Unity は Project Keystore フィールドと Project Key フィールドに自動的に入力します。 詳細については、Keystore Manager のドキュメントを参照してください。

Project Keystore

キーストアとは、アプリケーションのセキュリティのための署名鍵を保持するコンテナです。詳しくは、Android 開発者向けドキュメント Android keystore system を参照してください。

Project Keystore の設定で、開いているプロジェクトに使用するキーストアを選択します。キーストアをロードすると、Unity はそのキーストア内のすべてのキーをロードします。 開いているプロジェクトに既存のキーストアをロードして使用するには、以下を行います。

  1. Custom Keystore を有効にします。
  2. Select ドロップダウンを開き、 Browse を選択して、ファイルシステムからキーストアを選択します。
  3. Keystore password を入力します。

既存のキーストアがない場合は、カスタムキーストア を無効にしておきます。

Unity では、アプリケーションの署名にデバッグ用の鍵ストアを使用します。 デバッグ用のキーストアは、作業用のキーストアです。これにより、アプリケーションを署名し、ローカルでテストすることができます。ただし、アプリストアはこの方法で署名されたアプリを拒否します。これは、アプリストアが、デバッグ用のキーストアを使用したアプリケーションの有効性と所有権を検証できないためです。

プロパティ 説明 
Custom Keystore Custom Keystore を有効にして、既存のキーストアをロードして使用します。
Select Custom Keystore が有効な場合、これを使って使用するキーストアを選択します。 Select のドロップダウンにあるパーティション以下のキーストアは、あらかじめ定義された専用の場所に保存されています。詳しくは、キーストアの場所の選択 を参照してください。
パス キーストアのパスを入力する必要はありません。選択したキーストアに基づいて Unity が提供します。
Password キーストアのパスワードを入力して、選択したキーストアをロードします。

Project Key

キーストアをロードすると、Unity はそのキーストア内のすべてのキーをロードします。Project Key 設定を使ってキーストアから 1 つのキーを選択し、開いているプロジェクトのアクティブキーとして使います。

プロパティ 説明 
Alias 開いているプロジェクトで使用するキーを選択します。
Password キーとなるパスワードを入力します。

Build

デフォルトでは、Unity は、Unity のインストール時に提供されたマニフェストファイル、Gradle テンプレート、Proguard ファイルを使ってアプリケーションをビルドします。これらを変更するには、Android Publishing Settings の Build セクションを使用します。

カスタムのマニフェストファイル、Gradle テンプレート、Proguard ファイルを使用する場合は、以下を行います。

  1. 該当するチェックボックスを有効にします。Unity はプロジェクト内にデフォルトファイルを作成し、チェックボックスの下にファイルの場所が表示されます。
  2. 新しいファイルを開いて、変更を加えます。
  3. このファイルに変更を保存してください。Unity は、このファイルに保存された変更を次回のアプリケーションビルド時に自動的に使用します。

Build セクションの設定は、現在のプロジェクトのビルドプロセスにのみ適用されます。

プロパティ 説明 
Custom Main Manifest Customizable version of the Android LibraryManifest.xml file. This file contains important metadata about your Android application. For more information about the responsibilities of the Main/Unity Library Manifest see Unity Library Manifest.
Custom Launcher Manifest Customizable version of the Android LauncherManifest.xml file. This file contains important metadata about your Android application’s launcher. For more information about the responsibilities of the Unity Launcher Manifest see Unity Launcher Manifest.
Custom Main Gradle Template Customizable version of the mainTemplate.gradle file. This file contains information on how to build your Android application as a library. For more information see documentation on Providing a custom Gradle Template.
Custom Launcher Gradle Template Customizable version of the launcherTemplate.gradle_ file. This file contains instructions on how to build your Android application. For more information see documentation on build.gradle templates.
Custom Base Gradle Template Customizable version of the baseProjectTemplate.gradle file. This file contains configuration that is shared between all other templates and Gradle projects. For more information see documentation on build.gradle templates.
Custom Gradle Properties Template Customizable version of the gradle.properties file. This file contains configuration settings for the Gradle build environment. This includes:
- The JVM (Java Virtual Machine) memory configuration.
- A property to allow Gradle to build using multiple JVMs.
- A property for choosing the tool to do the minification.
- A property to not compress native libs when building an app bundle.
Custom Proguard File Customizable version of the proguard.txt file. This file contains configuration settings for the minification process. If minification removes some Java code which should be kept, you should add a rule to keep that code in this file. For more information see documentation on Minification.

Minify

小型化 (Munification) とは、アプリケーションのコードを縮小、難読化、最適化するプロセスです。コードサイズを縮小し、コードを逆アセンブルしにくくすることができます。Minify の設定を使って、いつ、どのように Unity がビルドに小型化を適用するかを定義します。

ほとんどの場合、リリースビルドにのみ小型化を適用し、デバッグビルドには適用しないのが良い習慣です。小型化には時間がかかり、ビルドが遅くなる可能性があるからです。また、コードが小型化されることで、デバッグがより複雑になる可能性があります。

Munify セクションの設定は、現在のプロジェクトのビルドプロセスにのみ適用されます。

プロパティ 説明 
Use R8 デフォルトでは、Unity は小型化に Proguard を使用します。このチェックボックスを有効にすると、代わりに R8 を使用します。
Release リリースビルド時にアプリケーションのコードを小型化したい場合は、このチェックボックスを有効にします。
Debug デバッグビルド時にアプリケーションのコードを小型化したい場合は、このチェックボックスを有効にします。

Split Application Binary

Split Application Binary オプションを有効にすると、出力パッケージをメイン (APK) パッケージと拡張 (OBB) パッケージに分割します。これは 100 MB を超えるアプリケーションを公開する場合は、 Goolge Play ストアによって必須とされています。



  • 5.5 のアップデート機能
  • Sustained Performance Mode は 2017.3 で追加
  • .NET 4.x ランタイムは 2018.1 で追加
  • Android 複数のAPK 機能は 2018.2 で追加
  • Android 用 OpenGL ES 3.2 サポートは、2019.1 で追加NewIn20191
  • Input System プレビューは Unity 2019.1 で追加
  • Render outside safe area は Unity 2019.1 で追加
  • Warn about App Bundle size オプションは Unity 2019.2 で追加
  • GPU Skinning の名称が Unity 2019.3 で Compute Skinning に変更されました
  • Vuforia は Unity 2019.3 で削除
  • ビルトイン XR SDK のサポートは Unity 2019.3 で非推奨NewIn20193
  • テクスチャ圧縮用に更新
Android 用の環境設定
Android キーストア