Android 用ゲームの開発について
Unity Remote

Android 環境の設定

To build and run for Android, you must install the Unity Android Build Support platform component. you also need to install the Android Software Development Kit (SDK) and NDK, which are required to build and run any code on your Android device. By default, Unity installs a Java Development Kit based on OpenJDK.

1. Install Android Build Support and the Android SDK & NDK tools

Use the Unity Hub to install Android Build Support and the required Android SDK & NDK tools:

Add Android components
Add Android components

You can install Android Build Support and the Android SDK & NDK tools when you install the Unity Editor, or add them at a later time.

For information on adding the Android components at install time, see Installing Unity.

For information on adding the Android components to an existing installation, see Adding components to the Editor.

2. Enable USB debugging on your device

To enable USB debugging, you must enable Developer options on your device. To do this, find the build number in your device’s Settings menu. The location of the build number varies between devices; for stock Android, it’s usually Settings > About phone > Build number. For specific information on your device and Android version, refer to your hardware manufacturer.

上記の説明にしたがってビルド番号を捜したら、ビルド番号を 7 回タップします。タップするたびに小さなポップアップ画面に「デベロッパーになるまであと X ステップです。」と表示され、X が残りのタップの回数のカウントダウンになります。7 回目のタップで開発者向けオプションがアンロックされます。

ノート バージョン 4.2 (Jelly Bean) より古い OS では、開発者向けオプションはデフォルトで有効になっています。

Go to Settings > Developer options, and check the USB debugging checkbox. Android now enters debug mode when it is connected to a computer via USB.

Connect your device to your computer using a USB cable. If you are developing on a Windows computer, you might need to install a device specific USB driver. See the manufacture website for your device for additional information.

設定手順は Windows と macOS では異なり、詳細は Android developer ウェブサイトに説明されています。Android デバイスを SDK に接続する詳しい情報は、Android デベロッパードキュメントの アプリを実行する のセクションを参照してください。

Using an alternate Java Development Kit, Android SDK, or NDK

Unity recommends that you use the Unity Hub to install Android SDK & NDK tools, to ensure that you receive the correct versions and configuration. Unity installs Android SDK & NDK tools respectively in the SDK and NDK folders under /Unity/Hub/Editor/[EditorVersion]/Editor/Data/PlaybackEngines/AndroidPlayer/.

If you manually install the Android SDK & NDK tools in another location, and you do not want to duplicate the installation, you can specify the location in the Unity Preferences window. To do this, go to Preferences > External tools and enter the directory paths in the SDK and NDK fields:

Preferences window showing external tools settings for Android
Preferences window showing external tools settings for Android

Warning: Unity does not officially support versions of the JDK, SDK, or NDK other than the ones it supplies.

To change the JDK, SDK, or NDK that Unity uses to build Android apps:

  1. プロジェクトを開きます。

  2. Preferences ウィンドウを開きます。
    • In the Editor for Windows and Linux, navigate to Edit > Preferences.
    • macOS 版エディターでは Unity > Preferences に移動します。
  3. 左側のナビゲーションペインで External Tools を選択します。

To change the JDK:

  1. Uncheck JDK Installed with Unity (recommended).
  2. In the JDK field, enter the path to the JDK or use the Browse button to locate it.

To change the Android SDK:

  1. Uncheck Android SDK Tools Installed with Unity (recommended).
  2. In the SDK field, enter the path to the JDK or use the Browse button to locate it.

To change the NDK:

  1. Uncheck Android NDK Installed with Unity (recommended).
  2. In the NDK field, enter the path to the JDK or use the Browse button to locate it.

2018–11–21 編集レビュー を行って修正されたページ

Android 用ゲームの開発について
Unity Remote