Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions android_env/components/config_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,11 @@ class EmulatorConfig(SimulatorConfig):
# The number of times to try launching the emulator before reinstalling
# (reinstall on the n+1-st try).
launch_n_times_without_reinstall: int = 2
# If True, use the raw on-device server instead of EmulatorSimulator.
use_raw_server: bool = False
# If True, enable audio capture from the device. Only applicable if
# use_raw_server is True.
enable_audio: bool = False


@dataclasses.dataclass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import glob
import os
import shutil
import subprocess
import tempfile

Expand Down Expand Up @@ -164,8 +165,14 @@ def confirm_shutdown(self) -> None:
def close(self):
"""Clean up launcher files and processes."""
if not self._is_closed:
self._local_tmp_dir_handle.cleanup()
self.confirm_shutdown()
if os.path.exists(self._logfile_path):
try:
shutil.copyfile(self._logfile_path, '/tmp/emulator_output_debug')
logging.info('Copied emulator log to /tmp/emulator_output_debug')
except Exception as e: # pylint: disable=broad-exception-caught
logging.error('Failed to copy emulator log: %s', e)
self._local_tmp_dir_handle.cleanup()
self._is_closed = True

def __del__(self):
Expand Down
Loading