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 351785 b4b843abf463252b8177c12268b19c9ade761224
parent 351784 c155349cb40312927dd7c1f9756598e28ac949d2
child 351786 58c36d9ae2af72144b7dd995b4f2344f543c0f7d
push id15527
push userbmo:rail@mozilla.com
push dateFri, 15 Apr 2016 01:44:41 +0000
reviewersjmaher
bugs1264656
milestone48.0a1
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.