Bug 1264656 - Avoid file exists error in |mach android-emulator --force-update|; r=jmaher
authorGeoff Brown <gbrown@mozilla.com>
Thu, 14 Apr 2016 13:35:05 -0600
changeset 293292 b4b843abf463252b8177c12268b19c9ade761224
parent 293291 c155349cb40312927dd7c1f9756598e28ac949d2
child 293293 58c36d9ae2af72144b7dd995b4f2344f543c0f7d
push id30178
push usercbook@mozilla.com
push dateFri, 15 Apr 2016 09:42:06 +0000
treeherdermozilla-central@afd82f887093 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmaher
bugs1264656
milestone48.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1264656 - Avoid file exists error in |mach android-emulator --force-update|; r=jmaher
testing/mozbase/mozrunner/mozrunner/devices/android_device.py
--- 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.