🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/interactions/is-locked.yml) # 设备是否锁定 检查设备是否被锁定 [//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/interactions/is-locked.yml) ## 使用样例 ```java // Java boolean isLocked = driver.isDeviceLocked(); ``` ```python # Python self.driver.is_locked() ``` ```javascript // Javascript // webdriver.io example driver.isLocked(); // wd example let isLocked = await driver.isLocked(); ``` ```ruby # Ruby # ruby_lib example device_locked? # ruby_lib_core example @driver.device_locked? ``` ```php # PHP // TODO PHP sample ``` ```csharp // C# bool isLocked = driver.IsLocked(); // Supported by IOSDriver & AndroidDriver ``` [//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/interactions/is-locked.yml) ## 支持 [//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/interactions/is-locked.yml) ### Appium Server |平台|驱动|平台版本 |Appium 版本|驱动版本| |--------|----------------|------|--------------|--------------| | iOS | [XCUITest](../drivers/ios-xcuitest.md) | None | None | None | | | [UIAutomation](../drivers/ios-uiautomation.md) | None | None | None | | Android | [Espresso](../drivers/android-espresso.md) | ?+ | 1.9.0+ | All | | | [UiAutomator2](../drivers/android-uiautomator2.md) | ?+ | 1.6.0+ | All | | | [UiAutomator](../drivers/android-uiautomator.md) | 4.3+ | All | All | | Mac | [Mac](../drivers/mac.md) | None | None | None | | Windows | [Windows](../drivers/windows.md) | 10+ | 1.6.0+ | All | [//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/interactions/is-locked.yml) ### Appium Clients |语言|支持|文档| |--------|-------|-------------| |[Java](https://github.com/appium/java-client/releases/latest)| All | [appium.github.io](http://appium.github.io/java-client/io/appium/java_client/LocksDevice.html#isDeviceLocked--) | |[Python](https://github.com/appium/python-client/releases/latest)| All | [appium.github.io](https://appium.github.io/python-client-sphinx/webdriver.extensions.html#webdriver.extensions.hw_actions.HardwareActions.is_locked) | |[Javascript (WebdriverIO)](http://webdriver.io/index.html)| All | | |[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | [github.com](https://github.com/admc/wd/blob/master/lib/commands.js#L2407) | |[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [www.rubydoc.info](https://www.rubydoc.info/github/appium/ruby_lib_core/Appium/Core/Device#device_locked%3F-instance_method) | |[PHP](https://github.com/appium/php-client/releases/latest)| All | [github.com](https://github.com/appium/php-client/) | |[C#](https://github.com/appium/appium-dotnet-driver/releases/latest)| All | [github.com](https://github.com/appium/appium-dotnet-driver/blob/master/src/Appium.Net/Appium/Android/AndroidDriver.cs) | [//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/interactions/is-locked.yml) ## HTTP API 规范 [//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/interactions/is-locked.yml) ### 端口 `POST /session/:session_id/appium/device/is_locked` [//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/interactions/is-locked.yml) ### URL 参数 |name|description| |----|-----------| |session_id|将指令发往的会话(session)的ID| [//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/interactions/is-locked.yml) ### JSON 参数 None [//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/interactions/is-locked.yml) ### 响应 如果设备已锁定,则为true,否则为false(`boolean`) [//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/interactions/is-locked.yml) ## 参考 * [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L367)