---
name: Lock
short_description: Lock the device


example_usage:
  java:
    |
      driver.lockDevice();
  python:
    |
      self.driver.lock();
  javascript_wd:
    |
      await driver.lock();

  javascript_wdio:
    |
      driver.lock();
  ruby:
    |
      @driver.lock
      @driver.lock(5) # lock 5 seconds
  php:
    |
      $driver->lock(5);
  csharp:
    |
      // TODO C# sample

client_docs:
  java: "http://appium.github.io/java-client/io/appium/java_client/android/LocksAndroidDevice.html#lockDevice--"
  python: "https://github.com/appium/python-client/blob/master/appium/webdriver/webdriver.py#L643"
  javascript_wdio: "http://webdriver.io/api/mobile/lock.html"
  javascript_wd: "https://github.com/admc/wd/blob/master/lib/commands.js#L2363"
  ruby: "http://www.rubydoc.info/github/appium/ruby_lib_core/Appium/Core/Device#lock-instance_method"
  php: "https://github.com/appium/php-client/" # TODO PHP documentation link
  csharp: "https://github.com/appium/appium-dotnet-driver/" # TODO Dotnet documentation link

# Driver support by platform
driver_support:
  ios:
    xcuitest: false
    uiautomation: true
  android:
    uiautomator2: true
    uiautomator: true
  mac:
    mac: false # TODO Confirm this that mouse movements
  windows:
    windows: true # TODO Confirm this
client_support:
  java: true
  python: true
  ruby: true
  php: true
  csharp: true
  javascript_wd: true
  javascript_wdio: true


# Information about the HTTP endpoints
endpoint:
  url: /session/:session_id/appium/device/lock
  method: POST
  url_parameters:
    - name: session_id
      description: ID of the session to route the command to
  json_parameters:
    - name: seconds
      type: number
      description: How long to lock the screen (iOS only).

# Links to specifications. Should link to at least one specification
specifications:
  jsonwp: https://github.com/appium/appium-base-driver/blob/master/lib/mjsonwp/routes.js#L307
