Add file commands
ADD
commands-yml/commands/device/files/pull-file.yml
+---
+name: Pull File
+short_description: Retrieve a file from the device's file system
+
+example_usage:
+ java:
+ |
+ byte[] fileBase64 = driver.pullFile("/path/to/device/foo.bar");
+ python:
+ |
+ file_base64 = self.driver.pull_file('/path/to/device/foo.bar');
+ javascript_wd:
+ |
+ let fileBase64 = await driver.pullFile('/path/to/device/foo.bar');
+ javascript_wdio:
+ |
+ let data = driver.pullFile('/data/local/tmp/file.txt');
+ ruby:
+ |
+ @driver.pull_file('/data/local/tmp/file.txt');
+ php:
+ |
+ // TODO PHP sample
+ csharp:
+ |
+ // TODO C# sample
+
+client_docs:
+ java: "http://appium.github.io/java-client/io/appium/java_client/InteractsWithFiles.html#pullFile-java.lang.String-"
+ python: "https://github.com/appium/python-client/blob/master/appium/webdriver/webdriver.py#L491"
+ javascript_wdio: "http://webdriver.io/api/mobile/pullFile.html"
+ javascript_wd: "https://github.com/admc/wd/blob/master/lib/commands.js#L2665"
+ ruby: "http://www.rubydoc.info/github/appium/ruby_lib/Appium/Core/Device:pull_file"
+ 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: true
+ uiautomation: true
+ android:
+ uiautomator2: true
+ uiautomator: true
+ mac:
+ mac: false # TODO: Verify this
+ windows:
+ windows: false # TODO: Verify 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: /wd/hub/session/:session_id/device/pull_file
+ method: POST
+ url_parameters:
+ - name: session_id
+ description: ID of the session to route the command to
+ json_parameters:
+ - name: path
+ type: string
+ description: Path on the device to pull file from
+ response:
+ - type: string
+ description: Contents of file in base64
+
+# 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#L390

ADD
commands-yml/commands/device/files/pull-folder.yml
+---
+name: Pull Folder
+short_description: Retrieve a folder from the device's file system
+
+example_usage:
+ java:
+ |
+ byte[] folder = driver.pullFolder("/path/to/device/foo.bar");
+ python:
+ |
+ folder_base64 = self.driver.pull_folder('/path/to/device/foo.bar');
+ javascript_wd:
+ |
+ let folderBase64 = await driver.pullFolder('/path/to/device/foo.bar');
+ javascript_wdio:
+ |
+ let data = driver.pullFolder('/data/local/tmp/file.txt');
+ ruby:
+ |
+ @driver.pull_folder('/data/local/tmp/file.txt');
+ php:
+ |
+ // TODO PHP sample
+ csharp:
+ |
+ // TODO C# sample
+
+client_docs:
+ java: "http://appium.github.io/java-client/io/appium/java_client/InteractsWithFiles.html#pullFolder-java.lang.String-"
+ python: "https://github.com/appium/python-client/blob/master/appium/webdriver/webdriver.py#L503"
+ javascript_wdio: "http://webdriver.io/api/mobile/pullFolder.html"
+ javascript_wd: "https://github.com/admc/wd/blob/master/lib/commands.js#L2688"
+ ruby: "http://www.rubydoc.info/github/appium/ruby_lib/Appium/Core/Device:pull_folder"
+ 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: true
+ uiautomation: true
+ android:
+ uiautomator2: true
+ uiautomator: true
+ mac:
+ mac: false # TODO: Verify this
+ windows:
+ windows: false # TODO: Verify 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: /wd/hub/session/:session_id/device/pull_folder
+ method: POST
+ url_parameters:
+ - name: session_id
+ description: ID of the session to route the command to
+ json_parameters:
+ - name: path
+ type: string
+ description: Path on the device to pull file from
+ response:
+ - type: string
+ description: Contents of file in base64
+
+# 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#L393

ADD
commands-yml/commands/device/files/push-file.yml
+---
+name: Push File
+short_description: Place a file onto the device in a particular place
+
+example_usage:
+ java:
+ |
+ driver.pushFile("/path/to/device/foo.bar", new File("/Users/johndoe/files/foo.bar"));
+ python:
+ |
+ self.driver.push_file('/path/to/device/foo.bar', 'QXJlIHlvdXIgYmVlcnMgb2theT8=');
+ javascript_wd:
+ |
+ await driver.pushFileToDevice('/path/to/device/foo.bar', 'QXJlIHlvdXIgYmVlcnMgb2theT8=');
+ javascript_wdio:
+ |
+ let data = new Buffer("Hello World").toString('base64');
+ driver.pushFile('/data/local/tmp/file.txt', data);
+ ruby:
+ |
+ @driver.push_file('/Users/johndoe/path/to/app.apk');
+ php:
+ |
+ // TODO PHP sample
+ csharp:
+ |
+ // TODO C# sample
+
+client_docs:
+ java: "http://appium.github.io/java-client/io/appium/java_client/android/PushesFiles.html#pushFile-java.lang.String-java.io.File-"
+ python: "https://github.com/appium/python-client/blob/master/appium/webdriver/webdriver.py#L515"
+ javascript_wdio: "http://webdriver.io/api/mobile/pushFile.html"
+ javascript_wd: "https://github.com/admc/wd/blob/master/lib/commands.js#L2640"
+ ruby: "http://www.rubydoc.info/github/appium/ruby_lib/Appium/Core/Device:push_file"
+ 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: true
+ uiautomation: true
+ android:
+ uiautomator2: true
+ uiautomator: true
+ mac:
+ mac: false # TODO: Verify this
+ windows:
+ windows: false # TODO: Verify 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: /wd/hub/session/:session_id/device/push_file
+ method: POST
+ url_parameters:
+ - name: session_id
+ description: ID of the session to route the command to
+ json_parameters:
+ - name: path
+ type: string
+ description: Path to install the data to
+ - name: data
+ type: string
+ description: Contents of file in base64
+
+# 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#L387

MODIFY
docs/toc.js
docs/toc.js
@@ -158,6 +158,24 @@ module.exports = {
]],
["Execute Async", "execute-async.md"],
["Execute", "execute.md"],
+ ["Device", ["device",
+ ["App", ["app",
+ ["Install App", "install-app.md"],
+ ["Remove App", "remove-app.md"],
+ ["Is App Installed", "is-app-installed.md"]
+ ]],
+ ["Files", ["files",
+ ["Push File", "push-file.md"],
+ ["Pull File", "pull-file.md"],
+ ["Pull Folder", "pull-folder.md"],
+ ]],
+ ["Other", ["other",
+ ["Rotate", "rotate.md"],
+ ["Current Activity", "current-activity.md"],
+ ["Current Package", "current-package.md"],
+ ["Start Activity", "start-activity.md"],
+ ]]
+ ]]
]],
["Writing & Running Tests", ["writing-running-appium",
["Running Tests", "running-tests.md"],

Add file commands (#9360)