From 3e64db5d343b3dbd09466be838ef8dff48b70708 Mon Sep 17 00:00:00 2001 From: Kazuaki Matsuo Date: Thu, 15 Apr 2021 19:40:52 -0700 Subject: [PATCH 1/3] feat: set 'disableAnalytics true' --- lib/uiautomator2.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/uiautomator2.js b/lib/uiautomator2.js index 207deaa2f..f4f6b9c8b 100644 --- a/lib/uiautomator2.js +++ b/lib/uiautomator2.js @@ -266,6 +266,8 @@ class UiAutomator2Server { cmd.push('-e', 'DISABLE_SUPPRESS_ACCESSIBILITY_SERVICES', this.disableSuppressAccessibilityService); } cmd.push(INSTRUMENTATION_TARGET); + # Disable Google analytics + cmd.push('-e', 'disableAnalytics', true) const instrumentationProcess = this.adb.createSubProcess(['shell', ...cmd]); instrumentationProcess.on('output', (stdout, stderr) => { const output = _.trim(stdout || stderr); From b5cf1603a6e81764dfd3fa1da61fb755b3084017 Mon Sep 17 00:00:00 2001 From: Kazuaki Matsuo Date: Thu, 15 Apr 2021 19:43:15 -0700 Subject: [PATCH 2/3] fix syntax --- lib/uiautomator2.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/uiautomator2.js b/lib/uiautomator2.js index f4f6b9c8b..70d4133f3 100644 --- a/lib/uiautomator2.js +++ b/lib/uiautomator2.js @@ -266,8 +266,8 @@ class UiAutomator2Server { cmd.push('-e', 'DISABLE_SUPPRESS_ACCESSIBILITY_SERVICES', this.disableSuppressAccessibilityService); } cmd.push(INSTRUMENTATION_TARGET); - # Disable Google analytics - cmd.push('-e', 'disableAnalytics', true) + // Disable Google analytics to prevent possible fatal exception + cmd.push('-e', 'disableAnalytics', true); const instrumentationProcess = this.adb.createSubProcess(['shell', ...cmd]); instrumentationProcess.on('output', (stdout, stderr) => { const output = _.trim(stdout || stderr); From 667ae1b31b4a4be91c5b0d237b7002509fa4d6b1 Mon Sep 17 00:00:00 2001 From: Kazuaki Matsuo Date: Fri, 16 Apr 2021 14:35:40 +0900 Subject: [PATCH 3/3] tweak the place --- lib/uiautomator2.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/uiautomator2.js b/lib/uiautomator2.js index 70d4133f3..bd7422a4d 100644 --- a/lib/uiautomator2.js +++ b/lib/uiautomator2.js @@ -265,9 +265,9 @@ class UiAutomator2Server { if (_.isBoolean(this.disableSuppressAccessibilityService)) { cmd.push('-e', 'DISABLE_SUPPRESS_ACCESSIBILITY_SERVICES', this.disableSuppressAccessibilityService); } - cmd.push(INSTRUMENTATION_TARGET); // Disable Google analytics to prevent possible fatal exception cmd.push('-e', 'disableAnalytics', true); + cmd.push(INSTRUMENTATION_TARGET); const instrumentationProcess = this.adb.createSubProcess(['shell', ...cmd]); instrumentationProcess.on('output', (stdout, stderr) => { const output = _.trim(stdout || stderr);