Automating TvOS

Bqurious, now allows automating TvOS apps since version 12.0.0. It’s similar to recording tests for mobile applications. One key difference is that we use keyboard arrow keys (up, down, left, right) to navigate to the element and record it just like you would use the AppleTv Remote to navigate the app. A new action (pressRemoteButton) has been introduced to simulate the TvOS remote.

Key points to remember:

  • The keyword pressRemoteButton will be recorded to navigate to the element. Exactly like you navigate to the particular element on your tvOS app.
  • For entering values in the textbox, while recording, click on the text field & use your system’s keyboard to enter the value. Press the tab key to move to the next element.
  • Use the arrow keys of your system’s keyboard to navigate to the element.

You can use the click action instead of pressRemoteButton if you feel that the sequence on the element is not fixed. However, be informed that click maybe a little flaky due to the underlying Apple Technology.

Setting up Apple TV 4K for automating TvOS #

Apple TV 4K does not come with a USB port and requires wireless pairing with Xcode for automation to work.

  1. Ensure your Mac and Apple TV are connected to the same network
  2. Open Xcode and go to Window > Devices and Simulators
  3. On the Apple TV, go to Settings > Remotes and Devices > Remote App and Devices
  4. Following message should show up on Xcode’s Devices and Simulators window.
  5. Click on “Pair with [Your Apple TV]” button.
  6. A verification code will pop-up on Apple TV display, enter that code in Xcode.
  7. Click the Connect button.
  8. You should now have your Mac showing up in Apple TV’s Remote App and Devices screen.
  9. You should also have your Apple TV now showing up on Xcode’s Devices and Simulators window.

Watch a video :