lock
Lock the device screen.
Usage​
await browser.lock(seconds)
Parameters​
| Name | Type | Details |
|---|---|---|
secondsoptional | number | How long to lock the screen in seconds (iOS only) |
Examples​
lock.js
it('should lock the screen', async () => {
// Lock the screen indefinitely
await browser.lock()
})
lock.timeout.js
it('should lock the screen for 5 seconds (iOS only)', async () => {
// Lock the screen for 5 seconds, then auto-unlock (iOS only)
await browser.lock(5)
})
Support​
Supported platforms: iOS, Android
note
Refer to the official Appium driver documentation to see which driver versions support this command.