多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/emulator/power_ac.yml) # Emulate power state Emulate power state change on the connected emulator. [//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/emulator/power_ac.yml) ## Example Usage ```java // Java driver.setPowerAC(PowerACState.OFF); ``` ```python # Python self.driver.set_power_ac(Power.AC_OFF) ``` ```javascript // Javascript // webdriver.io example driver.powerAC('on') // Not supported ``` ```ruby # Ruby # ruby_lib example set_power_ac :on # ruby_lib_core example @driver.set_power_ac :on ``` ```php // Not supported ``` ```csharp // Not supported ``` [//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/emulator/power_ac.yml) ## Description For Android emulator. To set the state of the battery charger to connected or not. [//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/emulator/power_ac.yml) ## Support [//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/emulator/power_ac.yml) ### Appium Server |Platform|Driver|Platform Versions|Appium Version|Driver Version| |--------|----------------|------|--------------|--------------| | 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) | None | None | None | [//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/emulator/power_ac.yml) ### Appium Clients |Language|Support|Documentation| |--------|-------|-------------| |[Java](https://github.com/appium/java-client/releases/latest)| All | [appium.github.io](https://appium.github.io/java-client/) | |[Python](https://github.com/appium/python-client/releases/latest)| All | [appium.github.io](https://appium.github.io/python-client-sphinx/webdriver.extensions.android.html#webdriver.extensions.android.power.Power.set_power_ac) | |[Javascript (WebdriverIO)](http://webdriver.io/index.html)| None | | |[Javascript (WD)](https://github.com/admc/wd/releases/latest)| None | | |[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [www.rubydoc.info](https://www.rubydoc.info/github/appium/ruby_lib_core/master/Appium/Core/Android/Device/Emulator#set_power_ac-instance_method) | |[PHP](https://github.com/appium/php-client/releases/latest)| None | | |[C#](https://github.com/appium/appium-dotnet-driver/releases/latest)| None | | [//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/emulator/power_ac.yml) ## HTTP API Specifications [//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/emulator/power_ac.yml) ### Endpoint `POST /session/:session_id/appium/device/power_ac` [//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/emulator/power_ac.yml) ### URL Parameters |name|description| |----|-----------| |session_id|ID of the session to route the command to| [//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/emulator/power_ac.yml) ### JSON Parameters |name|type|description| |----|----|-----------| | state | `string` | set the state. on or off | [//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/emulator/power_ac.yml) ### Response null [//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/emulator/power_ac.yml) ## See Also * [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L415)