Bug 1264656 - Avoid file exists error in |mach android-emulator --force-update|; r=jmaher
--- a/testing/mozbase/mozrunner/mozrunner/devices/android_device.py
+++ b/testing/mozbase/mozrunner/mozrunner/devices/android_device.py
@@ -349,19 +349,23 @@ class AndroidEmulator(object):
If the AVD directory is not found, or "force" is requested,
download the tooltool manifest associated with the AVD and then
invoke tooltool.py on the manifest. tooltool.py will download the
required archive (unless already present in the local tooltool
cache) and install the AVD.
"""
avd = os.path.join(
EMULATOR_HOME_DIR, 'avd', self.avd_info.name + '.avd')
+ ini_file = os.path.join(
+ EMULATOR_HOME_DIR, 'avd', self.avd_info.name + '.ini')
if force and os.path.exists(avd):
shutil.rmtree(avd)
if not os.path.exists(avd):
+ if os.path.exists(ini_file):
+ os.remove(ini_file)
url = '%s/%s' % (TRY_URL, self.avd_info.tooltool_manifest)
_download_file(url, 'releng.manifest', EMULATOR_HOME_DIR)
_tooltool_fetch()
self._update_avd_paths()
def start(self):
"""
Launch the emulator.