Missing `android_device`

オープン
#418 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 6 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
32/100
issue の種類
ドキュメント
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
android

調査の方向性

リンクされた Android インストルメンテーションテストのドキュメントから始め、Bazel 8.4.2 上の rules_android 0.6.6 に対して、示されている bazel query を再現してください。見つからない android_device の失敗を、issue で引用されているローカルエミュレータのフラグと比較してください。完了条件は、サポートされている Bazel 8 のエミュレータワークフロー、またはその代替手段が明確に文書化されることです。

索引モデルが issue の本文から書いたものです。

説明

Bazel 8 removed all native Android rules, including android_device, and I can't find any information about it.

How can I use emulators with bazel 8?

I wanted to set up an instrumentation test:

Stacktrace
bazel query --output=build @android_test_support//tools/android/emulated_devices/generic_phone:android_23_x86
ERROR: Traceback (most recent call last):
	File "/home/simeonwarren/.cache/bazel/_bazel_simeonwarren/8d894fd52f9ebddc50ede8e0430ca405/external/+_repo_rules+android_test_support/tools/android/emulated_devices/generic_phone/BUILD.bazel", line 13, column 12, in <toplevel>
		make_device(
	File "/home/simeonwarren/.cache/bazel/_bazel_simeonwarren/8d894fd52f9ebddc50ede8e0430ca405/external/+_repo_rules+android_test_support/tools/android/emulated_devices/macro/make_device.bzl", line 120, column 16, in make_device
		new_devices(
	File "/home/simeonwarren/.cache/bazel/_bazel_simeonwarren/8d894fd52f9ebddc50ede8e0430ca405/external/+_repo_rules+android_test_support/tools/android/emulated_devices/macro/make_device.bzl", line 258, column 48, in new_devices
		_new_devices_for_image_and_emulator(
	File "/home/simeonwarren/.cache/bazel/_bazel_simeonwarren/8d894fd52f9ebddc50ede8e0430ca405/external/+_repo_rules+android_test_support/tools/android/emulated_devices/macro/make_device.bzl", line 327, column 24, in _new_devices_for_image_and_emulator
		make_android_device(
	File "/home/simeonwarren/.cache/bazel/_bazel_simeonwarren/8d894fd52f9ebddc50ede8e0430ca405/external/+_repo_rules+android_test_support/tools/android/emulated_devices/macro/make_device.bzl", line 350, column 11, in make_android_device
		native.android_device(
Error: no native function or rule 'android_device'

Environment:

  • Rules: bazel_dep(name = "rules_android", version = "0.6.6")
  • OS: Fedora Linux 41 (Server Edition)
  • Bazel: 8.4.2

It seems like I can use a local emulator, so it's not as big of a problem as I thought:

Bazel also supports testing directly on a locally launched emulator or connected device. Pass the flags --test_strategy=exclusive and --test_arg=--device_broker_type=LOCAL_ADB_SERVER to enable local testing mode. If there is more than one connected device, pass the flag --test_arg=--device_serial_number=$device_id where $device_id is the id of the device/emulator listed in adb devices.

主要言語
Java
スター
205
フォーク
113
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

bazelbuild/rules_android のほかの issue

bazelbuild/rules_android の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。