Skip to content

Add ability to disable logcat capture #12203

@sshock

Description

@sshock

Feature request

For performance reasons, e.g., when running appium over adb over tcp over wan with high latency, to reduce traffic it would be nice to have the ability to keep appium from capturing and sending all the logcat messages.

I believe it may be as simple as this patch to appium-android-driver, but I'm not familiar with appium so there could be more pieces involved.

diff --git a/lib/android-helpers.js b/lib/android-helpers.js
index d6e8b24..1c87f00 100644
--- a/lib/android-helpers.js
+++ b/lib/android-helpers.js
@@ -671,7 +671,12 @@ helpers.initDevice = async function (adb, opts) {
     await helpers.ensureDeviceLocale(adb, opts.language, opts.locale, opts.localeScript);
   }

-  await adb.startLogcat();
+  if (opts.skipLogCapture) {
+    logger.info(`'skipLogCapture' is set. Not running logcat.`);
+  } else {
+    await adb.startLogcat();
+  }
+
   if (opts.unicodeKeyboard) {
     return await helpers.initUnicodeKeyboard(adb);
   }
diff --git a/lib/desired-caps.js b/lib/desired-caps.js
index 923e91b..0967ede 100644
--- a/lib/desired-caps.js
+++ b/lib/desired-caps.js
@@ -186,6 +186,9 @@ let commonCapConstraints = {
   },
   skipDeviceInitialization: {
     isBoolean: true
+  },
+  skipLogCapture: {
+    isBoolean: true
   }
 };

Metadata

Metadata

Assignees

Labels

Androidrelated to Android-native driver(s)Enhancementfeature

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions