fix issue 87
This commit is contained in:
parent
852daa4e32
commit
40f6e67d83
|
@ -50,7 +50,7 @@ def convert_str_to_bool(str: str) -> bool:
|
||||||
|
|
||||||
|
|
||||||
def is_initialized() -> bool:
|
def is_initialized() -> bool:
|
||||||
return os.path.exists(INIT_FILE)
|
return not os.path.exists(INIT_FILE)
|
||||||
|
|
||||||
|
|
||||||
def finish_initialization():
|
def finish_initialization():
|
||||||
|
@ -196,8 +196,9 @@ def run():
|
||||||
|
|
||||||
avd_name = '{device}_{version}'.format(device=device.replace(' ', '_').lower(), version=ANDROID_VERSION)
|
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 = is_initialized()
|
||||||
|
|
||||||
if not is_initialized():
|
if is_first_run:
|
||||||
logger.info('Preparing emulator...')
|
logger.info('Preparing emulator...')
|
||||||
prepare_avd(device, avd_name)
|
prepare_avd(device, avd_name)
|
||||||
finish_initialization()
|
finish_initialization()
|
||||||
|
@ -207,7 +208,7 @@ def run():
|
||||||
with open("/root/android_emulator/config.ini", "a") as cfg:
|
with open("/root/android_emulator/config.ini", "a") as cfg:
|
||||||
cfg.write('\ndisk.dataPartition.size={dp}'.format(dp=dp_size))
|
cfg.write('\ndisk.dataPartition.size={dp}'.format(dp=dp_size))
|
||||||
|
|
||||||
if not is_initialized():
|
if is_first_run:
|
||||||
cmd = 'emulator/emulator @{name} -gpu off -verbose -wipe-data'.format(name=avd_name)
|
cmd = 'emulator/emulator @{name} -gpu off -verbose -wipe-data'.format(name=avd_name)
|
||||||
else:
|
else:
|
||||||
cmd = 'emulator/emulator @{name} -gpu off -verbose'.format(name=avd_name)
|
cmd = 'emulator/emulator @{name} -gpu off -verbose'.format(name=avd_name)
|
||||||
|
|
Loading…
Reference in a new issue