🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
# 更新设备的设置项 更新设备的指定设置项 ## 使用样例 ```java // Java driver.setSetting(Setting.WAIT_FOR_IDLE_TIMEOUT, 5000); ``` ```python # Python self.driver.update_settings({"sample": "value"})) ``` ```javascript // Javascript // webdriver.io example driver.updateSettings({nativeWebTap: true}); // wd example await driver.updateSettings({nativeWebTap: true}); ``` ```ruby # Ruby # ruby_lib example update_settings(sample: 'value') # ruby_lib_core example @driver.update_settings(sample: 'value') ``` ```php // Not supported ``` ```csharp // Not supported ``` ## 支持 ### Appium Server | 平台 | Driver | 平台版本 | Appium版本 | Driver版本 | |--------|----------------|------|--------------|--------------| | iOS | [XCUITest](../../drivers/ios-xcuitest.md) | 9.3+ | 1.6.0+ | All | | | [UIAutomation](../../drivers/ios-uiautomation.md) | 8.0 to 9.3 | All | All | | 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) | ?+ | 1.6.4+ | All | | Windows | [Windows](../../drivers/windows.md) | 10+ | 1.6.0+ | All | ### Appium 客户端 | 语言 | 支持版本 | 文档 | |--------|-------|-------------| |[Java](https://github.com/appium/java-client/releases/latest)| All | [appium.github.io](https://appium.github.io/java-client/io/appium/java_client/HasSettings.html#setSetting-io.appium.java_client.Setting-java.lang.Object-) | |[Python](https://github.com/appium/python-client/releases/latest)| None | [appium.github.io](https://appium.github.io/python-client-sphinx/webdriver.extensions.html#webdriver.extensions.settings.Settings.update_settings) | |[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#L3032) | |[Ruby](https://github.com/appium/ruby_lib/releases/latest)| None | [www.rubydoc.info](https://www.rubydoc.info/github/appium/ruby_lib_core/Appium/Core/Device#update_settings-instance_method) | |[PHP](https://github.com/appium/php-client/releases/latest)| None | | |[C#](https://github.com/appium/appium-dotnet-driver/releases/latest)| None | | ## HTTP API 规范 ### 终端 `POST /session/:session_id/appium/settings` ### URL 参数 | 名称 | 描述 | |----|-----------| |session_id|将指令发往的会话(session)的ID| ### JSON 参数 | 名称 | 类型 | 描述 | |----|----|-----------| | settings | `array<object>` | 存放需要更新的设置项和值的JSON对象, 设置项参考 [Settings API](../../advanced-concepts/settings.md). | ### 响应 null ## 参考 * [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L587) 本文由 [KangarooChen](https://github.com/KangarooChen) 翻译,Last english version: 2b60bef0264515c912137d038c8f64e580050497, 11 May 2020