Skip to content

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

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

xianjianlf2 wants to merge 2 commits into
google:mainfrom
xianjianlf2:fix/android-adb-server-port

Conversation

@xianjianlf2

@xianjianlf2 xianjianlf2 commented Sep 22, 2026 •

Copy link
Copy Markdown

When an ADB server is listening on the port selected by ANDROID_ADB_SERVER_PORT, Artemis 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 seven added regression cases cover default and explicit ports, constructor overrides, socket precedence, and startup synchronization into settings, subprocess environment, and ADB command arguments.

Fixes #122.

Synced with upstream main 351ca842 in a68b638 on 2026-10-30, including the third-party code reorganization. The PR still changes only four files relative to that upstream revision.

Validation on macOS / Python 3.12 with frozen dependencies:

  • ADB-focused tests: 24 passed, including all seven added regression cases (pytest tests/unit/core/test_adb_server_connection.py tests/unit/test_config_package.py -k adb).
  • make typecheck: passed, zero errors.
  • make lint: passed, including formatting, Ruff and the quality ratchet.
  • make test: 2443 passed, 86 failed, 11 skipped, 8 deselected. A pristine archive of upstream 351ca842, run with the same interpreter, dependencies and environment, gives 2436 passed, 86 failed, 11 skipped, 8 deselected. The 86 failing test IDs are exactly identical; no new full-suite failures were introduced.
  • Running the complete two focused modules independently gives 50 passed / 7 failed; pristine upstream gives 43 passed / the same 7 failed. Those unrelated configuration-builder tests require a Gemini API key in this isolated run. No real service credentials were supplied.
  • git diff --check: passed.

The full suite is not green in this local environment. No physical-device validation was performed. Implementation, regression tests and this refresh were prepared with OpenAI Codex assistance.

Synchronize with upstream 351ca84. The 24 ADB-focused tests pass; full-suite failures match the pristine upstream baseline. AI-assisted with OpenAI Codex.
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