diff --git a/src/android.py b/src/android.py index 389efa0..0d9af31 100644 --- a/src/android.py +++ b/src/android.py @@ -59,8 +59,10 @@ def install_package(android_path, emulator_file, api_level, sys_img): # Install package based on given android version cmd = 'echo y | android update sdk --no-ui -a -t android-{api},sys-img-{sys_img}-android-{api}'.format( api=api_level, sys_img=sys_img) - logger.info('Android installation command : {install}'.format(install=cmd)) - subprocess.check_call('xterm -e \"{cmd}\"'.format(cmd=cmd), shell=True) + logger.info('SDK package installation command: {install}'.format(install=cmd)) + titel = 'SDK package installation process' + subprocess.check_call('xterm -T "{titel}" -n "{titel}" -e \"{cmd}\"'.format( + titel=titel, cmd=cmd), shell=True) def create_avd(android_path, device, skin, avd_name, api_level): @@ -88,8 +90,10 @@ def create_avd(android_path, device, skin, avd_name, api_level): cmd = 'echo no | android create avd -f -n {name} -t android-{api}'.format(name=avd_name, api=api_level) if device and skin: cmd += ' -d {device} -s {skin}'.format(device=device.replace(' ', '\ '), skin=skin) - logger.info('Emulator creation command : {cmd}'.format(cmd=cmd)) - subprocess.check_call('xterm -e \"{cmd}\"'.format(cmd=cmd), shell=True) + logger.info('AVD creation command: {cmd}'.format(cmd=cmd)) + titel = 'AVD creation process' + subprocess.check_call('xterm -T "{titel}" -n "{titel}" -e \"{cmd}\"'.format( + titel=titel, cmd=cmd), shell=True) def get_available_sdk_packages(): @@ -99,9 +103,8 @@ def get_available_sdk_packages(): :return: List of available packages. :rtype: bytearray """ - cmd = ['android', 'list', 'sdk'] - output_str = subprocess.check_output(cmd) logger.info('List of Android SDK: ') + output_str = subprocess.check_output('android list sdk'.split()) logger.info(output_str) return [output.strip() for output in output_str.split('\n')] if output_str else None diff --git a/src/appium.py b/src/appium.py index 98b6b00..b55b007 100644 --- a/src/appium.py +++ b/src/appium.py @@ -30,8 +30,9 @@ def run(connect_to_grid, emulator_name, android_version): cmd += ' --nodeconfig {file}'.format(file=CONFIG_FILE) except ValueError as v_err: logger.error(v_err) - subprocess.check_call('xterm -T "{name}" -n "{name}" -e \"{cmd}\"'.format( - name=emulator_name, cmd=cmd), shell=True) + titel = 'avd name: {name}'.format(name=emulator_name) + subprocess.check_call('xterm -T "{titel}" -n "{titel}" -e \"{cmd}\"'.format( + titel=titel, cmd=cmd), shell=True) def create_node_config(config_file, emulator_name, android_version, appium_host, appium_port,