2025 年 3 月 27 日より、AOSP のビルドとコントリビューションには aosp-main
ではなく android-latest-release
を使用することをおすすめします。詳細については、AOSP の変更をご覧ください。
テストと開発環境
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
セカンダリ ディスプレイを迅速かつ簡単にテストするには、システムが所有するシミュレーション ディスプレイを使用します。シミュレーション ディスプレイは system_server
UID を共有するため、信頼性が高く、すべてのデコレーション ウィンドウとアクティビティをホストできます。
ハードウェア接続(HDMI や DisplayPort over USB-C など)をサポートするデバイスがある場合は、外部ハードウェア ディスプレイを使用してテストできます。
デフォルトでは、システム UID の所有ではない仮想ディスプレイは信頼できないと見なされ、ユーザーデータの漏洩を防ぐために複数の制限が適用されます。
Android 10 のプラットフォームに追加された新しいウィンドウ機能をテストするには、デスクトップ モードを使用します。これはアプリ デベロッパーを対象とした開発者向けオプションで、デベロッパーはマルチディスプレイとフリーフォームのウィンドウモード環境でアプリをテストできます。


図 1. シミュレーション(上)と外部(下)の 2 つのディスプレイでのデスクトップ モード
デスクトップのようなエクスペリエンスを提供したいデバイス メーカーは、この機能を使用して、ウィンドウ機能を実装する推奨方法を提案できます。
- [デスクトップ モードに強制的に切り替え] 開発者向けオプションを有効にします。
- スマートフォンを再起動します。
- USB または Bluetooth 経由でマウスを接続します。
- 開発者向けオプションでシミュレーション ディスプレイを作成するか、ハードウェア ディスプレイを使用します。
- そのディスプレイのランチャーからアクティビティを起動し、マウスで操作します。
MD ランチャー(platform/development/samples/MultiDisplay
)は、ターゲットとするアクティビティの起動をテストして新しいインスタンスをリクエストするのに便利です。
このページのコンテンツやコードサンプルは、コンテンツ ライセンスに記載のライセンスに従います。Java および OpenJDK は Oracle および関連会社の商標または登録商標です。
最終更新日 2025-03-10 UTC。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["必要な情報がない","missingTheInformationINeed","thumb-down"],["複雑すぎる / 手順が多すぎる","tooComplicatedTooManySteps","thumb-down"],["最新ではない","outOfDate","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["サンプル / コードに問題がある","samplesCodeIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-03-10 UTC。"],[],[],null,["# Testing and development environment\n\nThe fastest and easiest way to test secondary displays is to use a simulated\ndisplay, which is owned by the system. Because it shares the `system_server`\nUID, it's trusted and allowed to host all decor windows and activities.\n\nIf you have a device that supports a hardware connection (for example, HDMI\nor DisplayPort over USB-C), you can use external hardware displays to test.\n\nBy default, virtual displays that aren't owned by the system UID are considered\nto be *not trusted* and a number of restrictions are applied to prevent the\nleaking of user data.\n\nUse desktop mode to test new windowing features and capabilities added to\nthe platform in Android 10. It's a developer option\ntargeted for app developers and enables developers to test apps in\nmulti-display and freeform windowing mode environments.\n\n**Figure 1.** Desktop mode on two displays, simulated (top) and\nexternal (bottom)\n\nWhen device manufacturers want to provide a desktop-like experience, use this\nfeature to showcase the recommended way to implement some of the windowing features.\n\n1. Enable the **Force desktop mode** developer option.\n2. Reboot the phone.\n3. Connect the mouse (via USB or Bluetooth).\n4. Create a simulated display from the developer options or use a hardware display.\n5. Launch activities from the launcher on that display and use the mouse to interact.\n\nMD Launcher (`platform/development/samples/MultiDisplay`) is useful\nfor testing a targeted activity launch and to request a new instance."]]