diff --git a/README.md b/README.md index 2458ebde1..0dda478c1 100644 --- a/README.md +++ b/README.md @@ -922,6 +922,16 @@ Name | Type | Required | Description | Example apks | Array<string> | yes | The path to APKs. Each path should be the full path to the apk to be installed, or an URL to a remote location. | `['/path/to/local.apk', 'https://github.com/appium/ruby_lib_core/blob/master/test/functional/app/api.apk.zip?raw=true']` options | object | no | Installation options. If you want enable `-g` option, you could specify that `{grantPermissions: true}`. `allowTestPackages` corresponds `-t`, `useSdcard` corresponds `-s`, `replace` corresponds `-r` (`-r` is enabled by default), `partialInstall` corresponds `-p`. | `{grantPermissions: true, partialInstall: true}` +### mobile: lock + +Lock the device (and optionally unlock it after a certain amount of time). Only simple (e.g. without a password) locks are supported. + +#### Arguments + +Name | Type | Required | Description | Example +--- | --- | --- | --- | --- +seconds | number|string | no | The number of seconds after which to unlock the device. Set to `0` or leave it empty to require manual unlock (e.g. do not block and automatically unlock afterwards). | 5 + ### mobile: unlock Unlocks the device if it is locked. Noop if the device's screen is not locked. @@ -935,6 +945,14 @@ type | string | yes | The unlock type. See the documentation on [appium:unlockTy strategy | string | no | Unlock strategy. See the documentation on [appium:unlockStrategy](#device-locking) capability for more details | uiautomator timeoutMs | number | no | Unlock timeout. See the documentation on [appium:unlockSuccessTimeout](#device-locking) capability for more details | 5000 +### mobile: isLocked + +Determine whether the device is locked. + +#### Returned Result + +Either `true` or `false` + ### mobile: refreshGpsCache Sends a request to refresh the GPS cache on the device under test. diff --git a/lib/commands/general.js b/lib/commands/general.js index 88fca4530..4e5954530 100644 --- a/lib/commands/general.js +++ b/lib/commands/general.js @@ -126,7 +126,9 @@ extensions.executeMobile = async function (mobileCommand, opts = {}) { installMultipleApks: 'mobileInstallMultipleApks', + lock: 'lock', unlock: 'mobileUnlock', + isLocked: 'isLocked', refreshGpsCache: 'mobileRefreshGpsCache', diff --git a/package.json b/package.json index a1260918d..6cedfbe54 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,7 @@ "dependencies": { "@babel/runtime": "^7.0.0", "appium-adb": "^9.11.0", - "appium-android-driver": "^5.10.0", + "appium-android-driver": "^5.10.4", "appium-chromedriver": "^5.3.1", "appium-uiautomator2-server": "^5.7.2", "asyncbox": "^2.3.1",