TvOS (Apple TV 4K)

During an Appium test you can use the buttons actions to simulate remote control navigation on the Apple TV.

driver.execute_script('mobile: pressButton', { name: 'down' })
driver.execute_script('mobile: pressButton', { name: 'select' })
await driver.execute('mobile: pressButton', { name: 'down' });
await driver.execute('mobile: pressButton', { name: 'select' });
driver.execute_script('mobile: pressButton', {'name': 'down'})
driver.execute_script('mobile: pressButton', {'name': 'select'})
driver.executeScript("mobile: pressButton", Map.of("name", "down"));
driver.executeScript("mobile: pressButton", Map.of("name", "select"));
driver.ExecuteScript("mobile: pressButton", new Dictionary<string, string> { { "name", "down" } });
driver.ExecuteScript("mobile: pressButton", new Dictionary<string, string> { { "name", "select" } });

The following buttons are available:

Button Name Behaviour
Home Return to the home screen.
Menu Return to the previous operation or screen. In the context of tvOS, it works as a traditional back button.
Select Select the item with the current focus.
Up Move the focus upward in the UI.
Down Move the focus downward in the UI.
Left Move the focus left in the UI.
Right Move the focus right in the UI.
Play/Pause Control media playback. Play/Pause is a toggle.
Was this page helpful?

Looking for More Help?

Have questions or need more information?
You can reach us via the following channels: