Apple TV#

Stb-tester supports all models of the Apple TV.

Remote control#

Stb-tester uses HDMI CEC to send remote control commands to the Apple TV.

You will need our USB CEC adapter. If we didn’t ship one with your Stb-tester device, contact support@stb-tester.com. Plug it in as per the diagram below — The Stb-tester Node will automatically use the CEC adapter if it is plugged in.

CEC is enabled by default on the Apple TV.

Key names#

In your test scripts you can use the following key names:

  • "KEY_POWER"

  • "KEY_UP"

  • "KEY_DOWN"

  • "KEY_LEFT"

  • "KEY_RIGHT"

  • "KEY_OK"

  • "KEY_BACK"

  • "KEY_TV"

  • "KEY_PLAY"

Power on / power off#

As of tvOS 17.5, the CEC command for “KEY_POWER” doesn’t wake the Apple TV from sleep. Use “KEY_TV” instead.

Once the Apple TV is on, “KEY_POWER” does behave the same way as the real remote control: A single press opens a pop-up menu, and a long-press puts the Apple TV to sleep.

Network control#

Stb-tester can use pyatv (an open-source Python library) to control the Apple TV over the network, to perform actions such as launching an app, or entering text when the on-screen search keyboard is visible. For detailed instructions see Controlling Apple TV with pyatv.

Apple TV settings#

We recommend the following configuration in the Apple TV’s Settings:

  • General > Appearance > Light

  • Accessibility > Display > Reduce Transparency = On

  • Accessibility > Motion > Auto-Play Video Previews = Off

These settings make image processing APIs such as stbt.match and stbt.press_and_wait more predictable.