Version: 2023.2
言語: 日本語
Android デバイスでのプロファイリング
アプリケーションへのパッチ適用

Unity Remote

Unity Remote is a downloadable application that helps with Android, iOS, and tvOS development. Unity Remote connects your target device to the Unity Editor and displays the visual output from the Editor on the target device’s screen at a reduced frame rate. It also sends live inputs from the target device back to the running project in Unity. This is useful to understand how an application looks and handles on the target device without creating a build.

The target device streams the following input data back to the Unity Editor:

  • タッチとスタイラスによる入力
  • 加速度計
  • ジャイロスコープ
  • デバイスのカメラストリーム
  • コンパス
  • GPS
  • Joystick names and input.

The Unity Editor still performs the application’s actual processing on the desktop machine. This means that the performance of the application isn’t an accurate reflection of how the built application wil perform on the target device. To get a more exact assessment of the application’s performance, build the application and test the build on the target device. Another side effect of processing the application in the Unity Editor is that the target platform is the same that you set in the Editor. This means it might not be set to the platform of the device that Unity Remote is running on. This is important to know if you use platform dependent compilation to do things like read input differently depending on whether the target platform is a desktop or mobile platform. If you do this, set the target platform to the platform that Unity Remote will run on.

要件と互換性

Unity Remote は、Android、iOS、tvOS デバイスに対応しています。Android デバイスに Unity Remote を接続するには、開発マシンに Android SDK がインストールされている必要があります。詳細は Android 用の環境設定 を参照してください。

ノート: Unity Remote は、以前のバージョンの Unity の iOS Remote および Android Remote アプリケーションに置き換わるものです。これらの旧アプリケーションの Unity によるサポートは終了しています。

Unity Remote の設定

Unity Remote の設定は、以下の手順で行います。

  1. ターゲットデバイスに Unity Remote をインストールします。
  2. ターゲットデバイスとコンピューターの USB 接続を設定します。
  3. Unity エディターを Unity Remote に接続します。

Unity Remote のインストール

Unity Remote アプリケーションは Google Play からダウンロードしてください。

USB 接続の設定

ターゲットデバイスをコンピューターに接続する前に、ターゲットデバイスの USB デバッグを有効にしてください。これを行う方法は、Android デバイスでのデバッグ を参照してください。USB デバッグを有効にしたら、Unity Remote を実行し、USB でターゲットデバイスをコンピューターに接続します。

Unity Remote と Unity エディターの接続

ターゲットデバイスがコンピューターに接続されていれば、Unity エディターはそれを検出できるはずです。ターゲットデバイスの Unity Remote を Unity エディターに接続するには、以下を行ってください。

  1. Editor 設定 (メニュー: Edit > Project Settings > Editor) を開きます。
  2. Unity Remote セクション内の Device に、使用したいデバイスを設定してください。

Device リストにターゲットデバイスが含まれていない場合は、まずターゲットデバイスの接続を外し、再接続してください。それでもうまくいかない場合は、USB 接続が正しく設定されているかどうか確認してください。これをテストするには、アプリケーションをビルドして実行し、Unity がアプリケーションをターゲットデバイスにインストールできるかどうか確認します。この方法については Android 用アプリケーションのビルド を参照してください。

重要: Unity は、接続された複数の Android デバイスでの Unity Remote の使用をサポートしていません。これを解決するために、Unity は、最初に検知した Android デバイスを自動的に選択します。複数の iOS/tvOS デバイスと1台の Android デバイスは同時に接続可能です。その場合、接続された全てのデバイスが Device リストに表示されます。

Preview an application in Unity Remote

In the Editor, click the Play button to see the application appear on the target device and in the Game View. As the application runs, Unity Remote streams input back to the Unity Editor and your scripts handle the inputs as if the scripts were running on the target device itself.

パフォーマンス

When you use Unity Remote, the application actually runs in the Editor, and Unity streams the visual content to the target device. The bandwidth between the Editor and the device is limited so Unity compresses the stream for transmission. The default compression method is JPEG which is a lossy compression method that reduces the image quality.

Change the compression method

One way to improve image quality on Unity Remote is to change the compression method to PNG. PNG is a lossless compression method that uses more bandwidth but doesn’t reduce the image quality. To change the compression method to PNG:

  1. Editor 設定 (メニュー: Edit > Project Settings > Editor) を開きます。
  2. In the Unity Remote section, set Compression to PNG.

Change the resolution

By default, when Unity streams the application to Unity Remote, it downsizes the application’s resolution. This results in a smaller image that reduces image quality but has a lower bandwidth requirement and produces better runtime performance. To preview your application at the application’s full resolution:

  1. Editor 設定 (メニュー: Edit > Project Settings > Editor) を開きます。

  2. In the Unity Remote section, set Resolution to Normal.

Android デバイスでのプロファイリング
アプリケーションへのパッチ適用