Add support for ADB server environment variables #64

Closed
opened 2025-08-09 17:13:13 +00:00 by fergalmoran · 0 comments
Owner

Originally created by @adelphes on 7/8/2020

ADB makes use of the following environment variables:

  • ADB_SERVER_SOCKET
  • ANDROID_ADB_SERVER_ADDRESS
  • ANDROID_ADB_SERVER_PORT

These variables are used to automatically specify how ADB should connect to its server instance.
135f4ab3dd/adb/commandline.cpp (1552)

This change adds support for automatically using these if vscode is launched with these environment variables configured.

To support more remote adb/device configurations:

  • adbPort has been replaced with adbSocket to allow the adb server hostname to be specified in the debug configuration.
  • jdwpPort has been added to allow the debugger connection port to be fixed (instead of choosing a random port on each launch).

Smaller improvements:

  • If an ADB command fails, the failing command is now included in the log.
  • Environment variables are printed during startup when trace is true.

Fixes #95

*Originally created by @adelphes on 7/8/2020* ADB makes use of the following environment variables: - ADB_SERVER_SOCKET - ANDROID_ADB_SERVER_ADDRESS - ANDROID_ADB_SERVER_PORT These variables are used to automatically specify how ADB should connect to its server instance. https://android.googlesource.com/platform/system/core/+/135f4ab3dd6c14f10a7bd1b1a4f9bfcf2135acb8/adb/commandline.cpp#1552 This change adds support for automatically using these if vscode is launched with these environment variables configured. To support more remote adb/device configurations: - `adbPort` has been replaced with `adbSocket` to allow the adb server hostname to be specified in the debug configuration. - `jdwpPort` has been added to allow the debugger connection port to be fixed (instead of choosing a random port on each launch). Smaller improvements: - If an ADB command fails, the failing command is now included in the log. - Environment variables are printed during startup when `trace` is true. Fixes #95
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/android-dev-ext#64
No description provided.