UNPKG

appium-android-driver

Version:

Android UiAutomator and Chrome support for Appium

28 lines 1.09 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.mobileSendTrimMemory = mobileSendTrimMemory; const driver_1 = require("appium/driver"); /** * Simulates the onTrimMemory() event for the given package. * Read https://developer.android.com/topic/performance/memory * for more details. * * @this {import('../driver').AndroidDriver} * @param {string} pkg The package name to send the `trimMemory` event to * @param {'COMPLETE' | 'MODERATE' | 'BACKGROUND' | 'UI_HIDDEN' | 'RUNNING_CRITICAL' | 'RUNNING_LOW' | 'RUNNING_MODERATE'} level The * actual memory trim level to be sent * @returns {Promise<void>} */ async function mobileSendTrimMemory(pkg, level) { if (!pkg) { throw new driver_1.errors.InvalidArgumentError(`The 'pkg' argument must be provided`); } if (!level) { throw new driver_1.errors.InvalidArgumentError(`The 'level' argument must be provided`); } await this.adb.shell(['am', 'send-trim-memory', pkg, level]); } /** * @typedef {import('appium-adb').ADB} ADB */ //# sourceMappingURL=memory.js.map