Merge pull request #229 from Seabath/master

Add optional env to set avd name
This commit is contained in:
Budi Utomo 2020-04-15 08:38:25 +02:00 committed by GitHub
commit a38691b5e2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View file

@ -32,6 +32,14 @@ Passing following environment variable to be able to connect laptop / pc camera
- EMULATOR_ARGS="-camera-back webcam0" - EMULATOR_ARGS="-camera-back webcam0"
Custom Avd name Arguments
-------------------------
Passing following environment variable to set a custom avd name
- AVD_NAME="customName"
Custom Emulator Arguments Custom Emulator Arguments
------------------------- -------------------------

View file

@ -206,7 +206,7 @@ def run():
custom_args=os.getenv('EMULATOR_ARGS', '') custom_args=os.getenv('EMULATOR_ARGS', '')
logger.info('Custom Args: {custom_args}'.format(custom_args=custom_args)) logger.info('Custom Args: {custom_args}'.format(custom_args=custom_args))
avd_name = '{device}_{version}'.format(device=device.replace(' ', '_').lower(), version=ANDROID_VERSION) avd_name = os.getenv('AVD_NAME', '{device}_{version}'.format(device=device.replace(' ', '_').lower(), version=ANDROID_VERSION))
logger.info('AVD name: {avd}'.format(avd=avd_name)) logger.info('AVD name: {avd}'.format(avd=avd_name))
is_first_run = not is_initialized(device) is_first_run = not is_initialized(device)