diff --git a/README.md b/README.md index 5ebd06726..4d7b7cf34 100644 --- a/README.md +++ b/README.md @@ -381,6 +381,19 @@ Starts Android logcat broadcast websocket on the same host and port where Appium Stops the previously started logcat broadcasting websocket server. This method will return immediately if no server is running. Read [Using Mobile Execution Commands to Continuously Stream Device Logs with Appium](https://appiumpro.com/editions/55-using-mobile-execution-commands-to-continuously-stream-device-logs-with-appium) for more details. +### mobile: deviceidle + +This is a wrapper to 'adb shell dumpsys deviceidle' interface. +Read [Diving Into Android 'M' Doze](https://www.protechtraining.com/blog/post/diving-into-android-m-doze-875) for more details. +This API only exists since Android 6. + +#### Arguments + +Name | Type | Required | Description | Example +--- | --- | --- | --- | --- +action | whitelistAdd or whitelistRemove | yes | The name of the action to perform | whitelistAdd +packages | string or string[] | yes | One or more package names to perfom the above action on | 'com.mycompany' + ### mobile: acceptAlert Tries to accept an Android alert. This method might not always be reliable as there is no single standard for how Android alerts should look like within the Accessibility representation. diff --git a/lib/execute-method-map.ts b/lib/execute-method-map.ts index 458f45c29..5f70e5cd5 100644 --- a/lib/execute-method-map.ts +++ b/lib/execute-method-map.ts @@ -112,6 +112,14 @@ export const executeMethodMap = { command: 'mobileStopLogsBroadcast', }, + 'mobile: deviceidle': { + command: 'mobileDeviceidle', + params: { + required: ['action'], + optional: ['packages'], + }, + }, + 'mobile: acceptAlert': { command: 'mobileAcceptAlert', params: { diff --git a/package.json b/package.json index 6c379fe53..e6949f168 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,7 @@ }, "dependencies": { "appium-adb": "^9.14.12", - "appium-android-driver": "^7.0.1", + "appium-android-driver": "^7.1.0", "appium-chromedriver": "^5.6.5", "appium-uiautomator2-server": "^5.12.2", "asyncbox": "^2.3.1",