Skip to content

Commit

Permalink
Remove adb_server_port from EmulatorLauncher.
Browse files Browse the repository at this point in the history
The emulator doesn't query the `ANDROID_ADB_SERVER_PORT` environment variable,
so it shouldn't be set. We can then remove one confusing argument from
`__init__()` since there's already an `adb_port`.

PiperOrigin-RevId: 561095163
  • Loading branch information
kenjitoyama authored and copybara-github committed Aug 30, 2023
1 parent 3ec9b03 commit c70fc50
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ def __init__(
self,
adb_path: str,
adb_port: int | None = None,
adb_server_port: int | None = None,
emulator_console_port: int | None = None,
grpc_port: int = -1,
emulator_path: str = '',
Expand All @@ -50,7 +49,6 @@ def __init__(
Args:
adb_path: Filesystem path to `adb` executable binary.
adb_port: ADB port for the Android device.
adb_server_port: Port of the ADB server deamon.
emulator_console_port: Port for telnet communication with the emulator.
grpc_port: Port for gRPC communication with the emulator.
emulator_path: Path to the emulator binary.
Expand All @@ -71,7 +69,6 @@ def __init__(

self._adb_path = os.path.expandvars(adb_path)
self._adb_port = adb_port
self._adb_server_port = adb_server_port
self._emulator_console_port = emulator_console_port
self._grpc_port = grpc_port
self._emulator_path = os.path.expandvars(emulator_path)
Expand Down Expand Up @@ -117,7 +114,6 @@ def launch_emulator_process(self) -> None:
'ANDROID_SDK_ROOT': self._android_sdk_root,
'ANDROID_AVD_HOME': self._android_avd_home,
'ANDROID_EMULATOR_KVM_DEVICE': self._kvm_device,
'ANDROID_ADB_SERVER_PORT': str(self._adb_server_port),
'LD_LIBRARY_PATH': ld_library_path,
'QT_XKB_CONFIG_ROOT': str(self._emulator_path[:-8] + 'qt_config/'),
'ANDROID_EMU_ENABLE_CRASH_REPORTING': '1',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ def setUp(self):
self._emulator_path = 'fake/path/emulator'
self._adb_path = 'fake/path/adb'
self._adb_port = 5554
self._adb_server_port = 1234
self._emulator_console_port = 5555
self._avd_name = 'my_avd_name'

Expand Down Expand Up @@ -64,7 +63,6 @@ def setUp(self):
'ANDROID_SDK_ROOT': '',
'ANDROID_AVD_HOME': '',
'ANDROID_EMULATOR_KVM_DEVICE': '/dev/kvm',
'ANDROID_ADB_SERVER_PORT': '1234',
'LD_LIBRARY_PATH': ld_library_path,
'QT_XKB_CONFIG_ROOT': str(self._emulator_path[:-8] + 'qt_config/'),
'ANDROID_EMU_ENABLE_CRASH_REPORTING': '1',
Expand All @@ -89,7 +87,6 @@ def test_launch(
launcher = emulator_launcher.EmulatorLauncher(
adb_path=self._adb_path,
adb_port=self._adb_port,
adb_server_port=self._adb_server_port,
emulator_console_port=self._emulator_console_port,
emulator_path=self._emulator_path,
avd_name=self._avd_name,
Expand Down Expand Up @@ -131,7 +128,6 @@ def test_grpc_port(
launcher = emulator_launcher.EmulatorLauncher(
adb_path=self._adb_path,
adb_port=self._adb_port,
adb_server_port=self._adb_server_port,
emulator_console_port=self._emulator_console_port,
emulator_path=self._emulator_path,
avd_name=self._avd_name,
Expand Down Expand Up @@ -176,7 +172,6 @@ def test_snapshot(
launcher = emulator_launcher.EmulatorLauncher(
adb_path=self._adb_path,
adb_port=self._adb_port,
adb_server_port=self._adb_server_port,
emulator_console_port=self._emulator_console_port,
emulator_path=self._emulator_path,
avd_name=self._avd_name,
Expand Down Expand Up @@ -224,7 +219,6 @@ def test_network_restrict(
launcher = emulator_launcher.EmulatorLauncher(
adb_path=self._adb_path,
adb_port=self._adb_port,
adb_server_port=self._adb_server_port,
emulator_console_port=self._emulator_console_port,
emulator_path=self._emulator_path,
avd_name=self._avd_name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@ def __init__(
emulator_launcher_args.update({
'adb_path': self._adb_controller_args['adb_path'],
'adb_port': self._adb_port,
'adb_server_port': self._adb_controller_args['adb_server_port'],
'emulator_console_port': self._console_port,
'grpc_port': self._grpc_port,
'tmp_dir': tmp_dir,
Expand Down

0 comments on commit c70fc50

Please sign in to comment.