Skip to content

Use transport-id feature requests for scrcpy ADB#2682

Draft
quanru wants to merge 3 commits into
mainfrom
codex/android-scrcpy-features-fallback
Draft

Use transport-id feature requests for scrcpy ADB#2682
quanru wants to merge 3 commits into
mainfrom
codex/android-scrcpy-features-fallback

Conversation

@quanru

@quanru quanru commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Prefer transport-id qualified feature requests for deterministic scrcpy ADB selectors instead of waiting for the multi-device host:features failure.
  • Resolve { serial } selectors to the matching device transportId, use existing { transportId } selectors directly, and keep non-deterministic selectors delegated to upstream @yume-chan/adb behavior.
  • Reuse the internal transport-id feature handling from both @midscene/android and @midscene/android-playground through an @midscene/android/internal/* entry point instead of the public root API.
  • Cover serial, direct transport-id, upstream delegation, unresolved serials, resolver failures, feature-request errors, connection disposal, and idempotent installation with unit tests.

Root Cause

@yume-chan/adb@2.5.1 and the current 2.6.0 release still query features through createDeviceConnection(device, "host:features"). On some multi-device ADB server environments, especially the reported Ubuntu setup, that two-step path can fail because host:features is handled as a host service and is not reliably scoped to the selected device.

Midscene already knows the target device in the scrcpy paths, so this change resolves deterministic selectors to a concrete transportId first and then requests host-transport-id:<id>:features. Ambiguous selectors such as USB/TCP or undefined selectors still use the upstream implementation.

Validation

  • npx nx test @midscene/android -- tests/unit-test/adb-server-client-transport-id-features.test.ts tests/unit-test/scrcpy-adapter.test.ts
  • npx nx test @midscene/android-playground -- tests/unit/scrcpy-server.test.ts
  • npx nx build @midscene/android
  • npx nx build @midscene/android-playground
  • pnpm run lint

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 15, 2026

Copy link
Copy Markdown

Deploying midscene with  Cloudflare Pages  Cloudflare Pages

Latest commit: 88229fd
Status: ✅  Deploy successful!
Preview URL: https://1f9e0634.midscene.pages.dev
Branch Preview URL: https://codex-android-scrcpy-feature.midscene.pages.dev

View logs

@quanru quanru changed the title [codex] Add scrcpy ADB features fallback Add scrcpy ADB features fallback Jun 15, 2026
@quanru quanru changed the title Add scrcpy ADB features fallback Use transport-id feature requests for scrcpy ADB Jun 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant