docs: add tvos support doc [ci skip]
MODIFY
docs/en/about-appium/getting-started.md
docs/en/about-appium/getting-started.md
@@ -45,7 +45,7 @@ the Android SDK configured on your system.
At some point, make sure you review the driver documentation for the platform
you want to automate, so your system is set up correctly:
-- The [XCUITest Driver](/docs/en/drivers/ios-xcuitest.md) (for iOS apps)
+- The [XCUITest Driver](/docs/en/drivers/ios-xcuitest.md) (for iOS and tvOS apps)
- The [UiAutomator2 Driver](/docs/en/drivers/android-uiautomator2.md) (for Android apps)
- The [Windows Driver](/docs/en/drivers/windows.md) (for Windows Desktop apps)
- The [Mac Driver](/docs/en/drivers/mac.md) (for Mac Desktop apps)

MODIFY
docs/en/about-appium/platform-support.md
docs/en/about-appium/platform-support.md
@@ -14,7 +14,7 @@ iOS automation is supported with two drivers:
Please refer to these driver docs for setup instructions.
* Versions: 9.0 and up (as a rule, Appium supports the latest two iOS versions)
-* Devices: iPhone Simulator, iPad Simulator, and real iPhones and iPads
+* Devices: Simulator and real device for iPhone, iPad and tvOS
* Native app support: Yes, with debug version of .app (simulator),
or correctly-signed .ipa (real devices). Underlying support is provided by
Apple's [XCUITest](https://developer.apple.com/reference/xctest) (or [UIAutomation](https://web.archive.org/web/20160904214108/https://developer.apple.com/library/ios/documentation/DeveloperTools/Reference/UIAutomationRef/) for older versions)

MODIFY
docs/en/drivers/ios-xcuitest.md
docs/en/drivers/ios-xcuitest.md
@@ -46,6 +46,29 @@ the value `XCUITest`. Of course, you must also include appropriate
`platformName`, `platformVersion`, `deviceName`, and `app` capabilities, at
a minimum.
+The `platformName` should be `iOS` for iPhone or iPad. tvOS devices are available if the `platformName` is `tvOS`.
+
+- iOS
+ ```json
+ {
+ "automationName": "XCUITest",
+ "platformName": "iOS",
+ "platformVersion": "12.2",
+ "deviceName": "iPhone 8",
+ ...
+ }
+ ```
+- tvOS
+ ```json
+ {
+ "automationName": "XCUITest",
+ "platformName": "tvOS",
+ "platformVersion": "12.2",
+ "deviceName": "Apple TV",
+ ...
+ }
+ ```
+
### Capabilities
The XCUITest driver supports a number of standard [Appium

ADD
docs/en/writing-running-appium/ios/ios-tvos.md
+## tvOS support
+
+Appium 1.13.0+ has tvOS support via XCUITest driver.
+
+## Setup
+
+You can run tests for tvOS by changing the `platformName` capability like it is done below.
+
+```json
+{
+ "automationName": "XCUITest",
+ "platformName": "tvOS",
+ "platformVersion": "12.2",
+ "deviceName": "Apple TV",
+ ...
+}
+```
+
+## Limitations
+Gesture commands do not work for tvOS. Some commands such as pasteboard do not work as well.
+
+We can handle `focus` on tvOS by simply pressing keys such as up/down/left/right/home.
+tvOS does actions on the _focused_ element. You can get the value of the `focus` attribute via [Attributes API](http://appium.io/docs/en/commands/element/attributes/attribute/).
+
+
+## Basic Actions
+
+```ruby
+# Ruby
+
+element = @driver.find_element :accessibility_id, 'element on the app'
+# Returns true if the element is focused, otherwise false
+element.focused #=> 'true'
+# Appium moves the focus to the element by pressing the corresponding keys and clicking the element
+element.click
+# Get the app state
+@driver.app_state('test.package.name') # => :running_in_foreground
+# Press keys
+@driver.execute_script 'mobile: pressButton', { name: 'Home' }
+```
+
+```Python
+# Python
+
+element = driver.find_element_by_accessibility_id('element on the app')
+element.get_attribute('focused')
+element.click()
+driver.query_app_state('test.package.name')
+execute_script('mobile: pressButton', { 'name': 'Home' })
+```
+
+```java
+// Java
+WebElement element = driver.findElementByAccessibilityId("element on the app");
+element.getAttribute("focused");
+element.click();
+driver.queryAppState("test.package.name");
+driver.executeScript("mobile: pressButton", ImmutableMap.of("name", "Home"));
+```
+
+## More actions
+tvOS provides [remote controller](https://developer.apple.com/design/human-interface-guidelines/tvos/remote-and-controllers/remote/) based actions. Appium provides _Buttons_ actions via `mobile: pressButton`. These are `menu`, `up/down/left/right`, `home`, `playpause` and `select`. Available actions are enumerated in the error message if you send unsupported button name to the server.
+
+Appium calculates `up/down/left/right` and `select` sequence automatically if the combination of `find element/s` and `click` is provided. You should not care about which keys should be pressed to reach an arbitrary element every time.
+
+You can also handle setting a focus or starting/pausing a playback pressing button actions. `menu` button works as _back_ for iOS context in tvOS.
+
+## Resources
+- Related issue: https://github.com/appium/appium/pull/12401

MODIFY
docs/toc.js
docs/toc.js
@@ -237,6 +237,7 @@ module.exports = {
['iOS Predicate Guide', 'ios-predicate.md'],
['iOS Touch ID Guide', 'ios-touch-id.md'],
['iOS Install Certificate', 'ios-xctest-install-certificate.md'],
+ ['tvOS support', 'ios-tvos.md'],
]],
['Android', ['android',
['UiSelector Guide', 'uiautomator-uiselector.md'],

docs: add tvos support doc [ci skip] (#12428)