多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
# 拉取文件 从设备的文件系统中拉取指定文件 ## 使用样例 ```java // Java byte[] fileBase64 = driver.pullFile("/path/to/device/foo.bar"); ``` ```python # Python file_base64 = self.driver.pull_file('/path/to/device/foo.bar'); ``` ```javascript // Javascript // webdriver.io example let data = driver.pullFile('/data/local/tmp/file.txt'); // wd example let fileBase64 = await driver.pullFile('/path/to/device/foo.bar'); ``` ```ruby # Ruby # ruby_lib example pull_file('/data/local/tmp/file.txt') # ruby_lib_core example @driver.pull_file('/data/local/tmp/file.txt') ``` ```php # PHP $data = $driver->pullFile('data/local/tmp/file.txt'); ``` ```csharp // C# byte[] fileBase64 = driver.PullFile("/path/to/device/foo.bar"); ``` [//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/files/pull-file.yml) ## 支持 [//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/files/pull-file.yml) ### Appium Server |平台|驱动|平台版本|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) | 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/files/pull-file.yml) ### Appium Clients |语言|支持|文档| |--------|-------|-------------| |[Java](https://github.com/appium/java-client/releases/latest)| All | [appium.github.io](https://appium.github.io/java-client/io/appium/java_client/InteractsWithFiles.html#pullFile-java.lang.String-) | |[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.remote_fs.RemoteFS.pull_file) | |[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#L2665) | |[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#pull_file-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/AppiumDriver.cs) | [//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/files/pull-file.yml) ## HTTP API 规范 [//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/files/pull-file.yml) ### 端口 `POST /session/:session_id/appium/device/pull_file` [//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/files/pull-file.yml) ### URL参数 |名称|描述| |----|-----------| |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/files/pull-file.yml) ### JSON参数 |名称|类型|描述| |----|----|-----------| | path | `string` | 拉取的文件在设备上所在路径 | [//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/files/pull-file.yml) ### 响应 base64 编码文件内容 [//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/files/pull-file.yml) ## 参考 * [JSONWP Specification](https://github.com/appium/appium-base-driver/blob/master/lib/protocol/routes.js#L504)