Android: running emulator classified as hardware when adb device name is not generic*, so --virtual fails with ERR_NO_TARGET
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 82/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- android, typescript
- 领域
- mobile-dev
调研方向
从 dist/android/utils/adb.js 中的 parseAdbDevices 开始,issue 指出了用于分类 ADB 设备的 device: 名称检查。根据报告的 emulator-5554 属性验证行为,并检查 Android 设备列表测试。完成标准是:已连接的 emulator-<port> 即使设备名称为 emu64xa16k,也会列为虚拟设备,并且可以通过 --virtual 选择。
由索引模型根据 Issue 内容生成。
描述
Version: native-run 2.0.3 (latest on npm)
Platform: Linux x86_64, Android Emulator 37.1.11, AVD from the Pixel 10 profile with a 16 KB page-size system image (sdk_gphone16k_x86_64, API 37)
Description
A running emulator is classified as hardware, so --virtual cannot select it and run fails with ERR_NO_TARGET, even though adb lists the emulator as connected.
adb devices -l reports:
emulator-5554 device product:sdk_gphone16k_x86_64 model:sdk_gphone16k_x86_64 device:emu64xa16k transport_id:1
dist/android/utils/adb.js (parseAdbDevices) only treats a serial as an emulator when its device: property starts with generic:
const isGenericDevice = (properties['device'] || '').startsWith('generic');
const type = 'usb' in properties || isIP || !serial.startsWith('emulator') || !isGenericDevice ? 'hardware' : 'emulator';
Current emulator system images report device:emu64xa16k (and similar emu64* values), not generic*. The emulator therefore becomes type: 'hardware'.
Steps to reproduce
- Start an AVD whose system image reports a non-
genericdevice name, e.g. a recent Google APIs / 16 KB page-size image. native-run android --list --jsonlists it underdevices, andvirtualDevicesstays empty.native-run android --app app-debug.apk --virtualfails:
ERR_NO_TARGET: No target devices/emulators available.
The same command without --virtual installs on the emulator, because it is picked as a hardware device.
ionic cordova run android --emulator maps to --virtual, so Ionic Cordova live reload on an emulator is affected.
Expected
A serial of the form emulator-<port> that adb reports in the device state is a running emulator, whatever its device: property says. --virtual should select it.
Possible fix
Classify emulator-<port> serials as emulators without depending on the device: name, or additionally accept the emu* prefix. Alternatively, check ro.kernel.qemu / ro.boot.qemu from getprop, which getDevices already reads.
Related
#324: AVD home resolution ignores $ANDROID_USER_HOME/XDG locations. In the same setup that compounds this bug, because the fallback that would boot an AVD finds none.
- 主要语言
- TypeScript
- 星标
- 139
- 派生
- 35
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
ionic-team/native-run 的其他 Issue
-
难度 3/5 1-2 天 新手友好度 66/100
ionic-team/native-run#410 · 1 条评论 ·
-
tools not found?未关闭android
难度 4/5 3-5 天 新手友好度 25/100
ionic-team/native-run#395 ·
-
android
难度 3/5 1-2 天 新手友好度 28/100
ionic-team/native-run#390 · 1 条评论 ·
-
难度 4/5 3-5 天 新手友好度 38/100
ionic-team/native-run#389 ·
-
android
难度 3/5 1-2 天 新手友好度 35/100
ionic-team/native-run#387 · 1 个 reaction ·
查看 ionic-team/native-run 的全部 Issue
相似的 Issue
-
Remove unused dependencies可能已有人在做 @alastair-smith 今天认领。 未关闭chore other
难度 2/5 1-3 小时 新手友好度 78/100
alastair-smith/card-games#384 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
code-yeongyu/senpi#5571 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
nexu-io/open-design#9262 · 1 条评论 ·
维护者通常 1 天内回复
-
friction
难度 2/5 1-3 小时 新手友好度 72/100
kentcdodds/kody#4753 ·
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
难度 1/5 1 小时以内 新手友好度 62/100
lingdojo/kana-dojo#33508 · 1 条评论 · 5 个 reaction ·
维护者通常 1 天内回复