From 46112c166372f37e850bbaf71246ffcee90fb78f Mon Sep 17 00:00:00 2001 From: Vishhalghyv Date: Fri, 6 Mar 2020 07:04:26 +0530 Subject: [PATCH 1/3] fix: Added Cleaning up old of files on start of android dev --- src/extension-runners/firefox-android.js | 19 +++++++++++++++++++ src/extension-runners/index.js | 6 +++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/src/extension-runners/firefox-android.js b/src/extension-runners/firefox-android.js index 4584633d76..c6446f1c31 100644 --- a/src/extension-runners/firefox-android.js +++ b/src/extension-runners/firefox-android.js @@ -128,6 +128,12 @@ export class FirefoxAndroidExtensionRunner { adbBin, adbHost, adbPort, }); + const { + adbUtils, + selectedAdbDevice, + selectedArtifactsDir, + } = this; + await this.adbDevicesDiscoveryAndSelect(); await this.apkPackagesDiscoveryAndSelect(); await this.adbCheckRuntimePermissions(); @@ -141,6 +147,19 @@ export class FirefoxAndroidExtensionRunner { // NOTE: running Firefox for Android on the Android Emulator can be // pretty slow, we can run the following 3 steps in parallel to speed up // it a bit. + if (selectedArtifactsDir) { + log.debug('Cleaning up artifacts directory on the Android device...'); + await adbUtils.clearArtifactsDir(selectedAdbDevice); + } + + // Call all the registered cleanup callbacks. + for (const fn of this.cleanupCallbacks) { + try { + fn(); + } catch (error) { + log.error(error); + } + } await Promise.all([ // Start Firefox for Android instance if not started yet. // (Fennec would run in an temporary profile and so it is explicitly diff --git a/src/extension-runners/index.js b/src/extension-runners/index.js index 19fd60bc78..8a31bb8990 100644 --- a/src/extension-runners/index.js +++ b/src/extension-runners/index.js @@ -359,7 +359,11 @@ export function defaultReloadStrategy( setRawMode(stdin, true); } else if (keyPressed.name === 'r') { log.debug('Reloading installed extensions on user request'); - extensionRunner.reloadAllExtensions(); + extensionRunner.reloadAllExtensions() + .then(log.debug('Installed Extensions reloaded on user requesy')) + .catch(function(error) { + log.debug('Unable to reload installed extensions', error); + }); } } From 6ec3c250d51f01f5f4f9dec3476e36ec6711fafb Mon Sep 17 00:00:00 2001 From: Vishalghyv Date: Sat, 7 Mar 2020 11:50:47 +0530 Subject: [PATCH 2/3] Update firefox-android.js --- src/extension-runners/firefox-android.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/extension-runners/firefox-android.js b/src/extension-runners/firefox-android.js index c6446f1c31..bd3c13b2ba 100644 --- a/src/extension-runners/firefox-android.js +++ b/src/extension-runners/firefox-android.js @@ -147,11 +147,7 @@ export class FirefoxAndroidExtensionRunner { // NOTE: running Firefox for Android on the Android Emulator can be // pretty slow, we can run the following 3 steps in parallel to speed up // it a bit. - if (selectedArtifactsDir) { - log.debug('Cleaning up artifacts directory on the Android device...'); - await adbUtils.clearArtifactsDir(selectedAdbDevice); - } - + // Call all the registered cleanup callbacks. for (const fn of this.cleanupCallbacks) { try { From fe4f8d3c993fe0422185218f867a43335c289c54 Mon Sep 17 00:00:00 2001 From: Vishalghyv Date: Sat, 7 Mar 2020 11:55:50 +0530 Subject: [PATCH 3/3] Update firefox-android.js --- src/extension-runners/firefox-android.js | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/extension-runners/firefox-android.js b/src/extension-runners/firefox-android.js index bd3c13b2ba..9b164d42c5 100644 --- a/src/extension-runners/firefox-android.js +++ b/src/extension-runners/firefox-android.js @@ -128,12 +128,6 @@ export class FirefoxAndroidExtensionRunner { adbBin, adbHost, adbPort, }); - const { - adbUtils, - selectedAdbDevice, - selectedArtifactsDir, - } = this; - await this.adbDevicesDiscoveryAndSelect(); await this.apkPackagesDiscoveryAndSelect(); await this.adbCheckRuntimePermissions(); @@ -147,7 +141,6 @@ export class FirefoxAndroidExtensionRunner { // NOTE: running Firefox for Android on the Android Emulator can be // pretty slow, we can run the following 3 steps in parallel to speed up // it a bit. - // Call all the registered cleanup callbacks. for (const fn of this.cleanupCallbacks) { try {