Using a Raspberry Pi for iPhone Switch Control

Background

If a user enables Accessibility Switch Control on an iOS device, one or more external switches can operate it.
A user can pair a bluetooth keyboard to a phone, and any keyboard key can as a switch.

Manual test

I connected my phone to a bluetooth keyboard and used one key to end a phone call by tapping the red end call button.

Proposed automated test system

A Raspberry Pi or microcontroller such as an Adafruit feather can act as a bluetooth keyboard emulator.
It could programmatically control a phone.
XCUITest could communicate with the emulator through a web service or WebSocket or similar.
I may prototype this in the future.

Advantages

Disadvantages

References

Use Switch Control to navigate your iPhone, iPad, or iPod touch

https://support.apple.com/en-us/HT201370

iOS Switch Control on a Budget using Bluetooth Keyboards

https://www.youtube.com/watch?v=qDOVPdX9BE0
Shows Adafruit feather

Using a Raspberry Pi to end an iPhone phone call