Skip to content

fix(config): honor ANDROID_ADB_SERVER_PORT as an ADB port fallback - #146

Open
xianjianlf2 wants to merge 1 commit into
google:mainfrom
xianjianlf2:fix/android-adb-server-port
Open

xianjianlf2 wants to merge 1 commit into
google:mainfrom
xianjianlf2:fix/android-adb-server-port

Conversation

@xianjianlf2

Copy link
Copy Markdown

When an ADB server is listening on the port selected by ANDROID_ADB_SERVER_PORT, Artemis currently falls back to 5037 and cannot see the same devices as adb (reported in #122).

Accept ANDROID_ADB_SERVER_PORT as a validation alias for Settings.ADB_PORT. An explicitly configured ADB_PORT still wins; the default remains 5037. Existing ADB_SERVER_SOCKET selection is unchanged. The environment template documents the fallback.

The regression tests cover default and explicit ports, constructor overrides, socket precedence, and startup synchronization into settings, subprocess environment, and ADB command arguments. The two regression cases failed with 5037 != 8848 before the fix and pass afterward.

Fixes #122.

Validation on macOS / Python 3.12:

  • All 7 added regression cases pass; the complete ADB connection test module passes (20 tests).
  • A fresh process with only ANDROID_ADB_SERVER_PORT=8848 selects port 8848 and builds adb -H 127.0.0.1 -P 8848 devices.
  • make typecheck, Ruff formatting, Ruff lint for changed Python files, and the quality ratchet pass.
  • make test: 2108 passed, 88 failed, 6 skipped, 8 deselected. An unmodified checkout of main (371aa6d) has 2101 passed and the exact same 88 failing test IDs.
  • make lint encounters the same 11 existing Ruff violations in playground/backend_manager as unmodified main.

No physical-device validation was performed. Implementation and regression tests were prepared with Codex assistance.

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.

devices can not been attached when I changed the ANDROID_ADB_SERVER_PORT

1 participant