diff --git a/lib/android-helpers.js b/lib/android-helpers.js index c090a3da..639ff535 100644 --- a/lib/android-helpers.js +++ b/lib/android-helpers.js @@ -628,9 +628,14 @@ helpers.verifyUnlock = async function (adb) { }; helpers.initDevice = async function (adb, opts) { - await adb.waitForDevice(); - // pushSettingsApp required before calling ensureDeviceLocale for API Level 24+ - await helpers.pushSettingsApp(adb); + if (opts.skipDeviceInitialization) { + logger.info(`'skipDeviceInitialization' is set. Skipping device initialization.`); + } else { + await adb.waitForDevice(); + // pushSettingsApp required before calling ensureDeviceLocale for API Level 24+ + await helpers.pushSettingsApp(adb); + } + if (!opts.avd) { await helpers.setMockLocationApp(adb, SETTINGS_HELPER_PKG_ID); } @@ -638,6 +643,7 @@ helpers.initDevice = async function (adb, opts) { if (opts.language || opts.locale) { await helpers.ensureDeviceLocale(adb, opts.language, opts.locale, opts.localeScript); } + await adb.startLogcat(); if (opts.unicodeKeyboard) { return await helpers.initUnicodeKeyboard(adb); diff --git a/lib/desired-caps.js b/lib/desired-caps.js index 929f7be4..2669b155 100644 --- a/lib/desired-caps.js +++ b/lib/desired-caps.js @@ -181,6 +181,9 @@ let commonCapConstraints = { localeScript: { isString: true }, + skipDeviceInitialization: { + isBoolean: true + } }; let uiautomatorCapConstraints = {