Simulate arrow key press in UITextView during UI test

I would like to simulate pressing an arrow key on the hardware keyboard attached to an iPad. In a UI test for a macOS target I can do this:

XCUIElement.typeKey(.rightArrow, modifierFlags: [.option, .command])

but this won't compile for a iOS target supporting iPhone and iPad. Is there an alternative?

What I would like to achieve in the end is moving the text cursor at the beginning of a particular sentence by pressing Option-Command-Arrow left a certain number of times, but if someone knows a better way, I'd be happy to hear it.

Simulate arrow key press in UITextView during UI test
 
 
Q