2025 年 3 月 27 日より、AOSP のビルドとコントリビューションには aosp-main
ではなく android-latest-release
を使用することをおすすめします。詳細については、AOSP の変更をご覧ください。
Trade Federation コンソール
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
Trade Federation コンソールはオプションのコンポーネントです。デバイスの状態から現在進行中のテストまで、Trade Federation の状態や検出内容を表示できます。
並行して実行されている多数のテストをモニタリングし、各テストの進行状況を把握する優れたツールです。
コンソールにリーチする
Tradefed がビルドされると、パスから tradefed.sh
ランチャー スクリプトを利用できるようになり、そこからデフォルトでコンソールが起動します。
コンソールには tf >
プロンプトが表示されます。
コンソールでできること
コンソールの help
には、常に最新の情報が表示されます。
次のような興味深い機能があります。
- デバイスと、Tradefed に状態がどのように見えているかをリストする
list devices
- 現在実行中の呼び出しとそのメタデータをリストする
list invocations
- 実行中のすべての呼び出しと Tradefed のログを取得する
dump logs
コンソールを使用すれば、他ではまとめて表示できない状態をクエリすることで、Tradefed とデバイスで起こっていることをデバッグできます。
コンソールを無効にする方法
1 回限りのコマンドを実行する場合など、コンソールが必要ない場合もあります。スクリプトから Tradefed を実行する場合、またはその出力を直接パイプする場合は、コンソールを無効にする必要があります。コンソールを有効にした状態でスクリプトから Tradefed を実行すると、予期せぬ動作をする可能性があります。
コンソールが起動しないようにするには、commandAndExit
引数を指定して tradefed.sh
ランチャー スクリプトを実行します。
tradefed.sh run commandAndExit <usual command>
コンソールの予測入力
コンソールには、設定名の基本的な予測入力機能があります。
tf > run <hit TAB>
result in:
Display all 167 possibilities? (y or n)
run
の後に Tab キーを押すと、利用可能な設定の全リストを取得できます。名前の一部がすでに入力されている場合は、該当するすべての候補がコンソールに表示されます。
tf >run tf/<HIT TAB>
tf/acceptance tf/fake tf/func
tf/stress tf/uiautomator tf/unit-runner
tf >run tf/
これは、正確な設定名がわからない場合に便利です。
このページのコンテンツやコードサンプルは、コンテンツ ライセンスに記載のライセンスに従います。Java および OpenJDK は Oracle および関連会社の商標または登録商標です。
最終更新日 2025-03-26 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-26 UTC。"],[],[],null,["# Trade Federation Console\n\nThe Trade Federation Console is an optional component that allows you to inspect\nthe state of Trade Federation and what it sees, from the device states to the\ncurrent tests in progress.\n\nIt is a great tool for monitoring a large number of tests running in parallel\nand understanding the progress of each test.\n\nReach the console\n-----------------\n\nOnce Tradefed is built, the `tradefed.sh` launcher script is accessible from\nyour path and by default will take you to the console.\n\nThe console presents itself with the `tf \u003e` prompt.\n\nWhat can the console do?\n------------------------\n\nThe `help` of the console will always list the most up-to-date information.\nA few interesting features of it are:\n\n- List the devices and how Tradefed sees their state: `list devices`\n- List the currently running invocations and their metadata: `list invocations`\n- Get the logs of all running invocations and Tradefed: `dump logs`\n\nThe console allows you to debug what is happening in Tradefed and the devices by\nquerying some states that are not shown together anywhere else.\n\nHow do I disable the console?\n-----------------------------\n\nSometimes the console isn't needed, such as when running a one-time command. The\nconsole must be disabled when running Tradefed from a script or when\npiping its output directly. Running Tradefed from a script with the console\nenabled can cause unexpected behavior.\n\nTo prevent the console from starting, run the `tradefed.sh` launcher script with\nthe `commandAndExit` argument. \n\n tradefed.sh run commandAndExit \u003cusual command\u003e\n\nConsole autocompletion\n----------------------\n\nThe console provides basic autocompletion of configuration names. \n\n tf \u003e run \u003chit TAB\u003e\n result in:\n Display all 167 possibilities? (y or n)\n\nBy hitting TAB after the `run` you can get the full list of configurations\navailable. And if you have a partial name already typed in, the console will\nprint all the possibilities. \n\n tf \u003erun tf/\u003cHIT TAB\u003e\n\n tf/acceptance tf/fake tf/func\n tf/stress tf/uiautomator tf/unit-runner\n tf \u003erun tf/\n\nThis is a useful when you don't remember an exact configuration name."]]