Endpoint

Overview

Presses and releases one key. Locking and unlocking the phone are keys too:
  • lock turns the screen off and locks the phone, like pressing the power button. The session stays active. While the screen is off, screenshots are black and touches do nothing.
  • unlock wakes the phone and dismisses a lock screen without a passcode. On iPhone it presses Home, which can return an already-awake phone to the home screen. It does not bypass a passcode. Starting a session already wakes the phone, so you normally only need it after lock.
Requires an active session on each phone.

Request Body

string[]
required
The phones to act on.
string
One phone, instead of phoneIds. The answer’s data is then that phone’s result itself, not a list, and a failure on the phone is the request’s ok: false with the phone’s error (at the HTTP status of its code). Give phoneId or phoneIds, not both.
string
required
The key to press.A key the phone’s platform does not support gives that phone the error code unsupported.The foreground app decides how keyboard navigation works. Some iPhone text fields ignore Home and End; use meta with left or right where the app supports Command+Arrow navigation. Add shift to extend the selection.
string[]
Optional keyboard modifiers: shift, ctrl, alt, meta. These work with all keyboard keys, including a, c, x, z, cursor_home, cursor_end, page_up, page_down and caps_lock. home is the phone Home button; cursor_home is the text-navigation key. Hardware and navigation buttons such as home and lock do not accept modifiers.
object
Look at the screen after the action, in the same answer. The hub takes a frame before the action, does it, waits until the screen settles (two frames about 300 ms apart that look the same, for at most settleMs), and adds screen, effect and, when the action should have changed the screen and did not, warnings to the phone’s result. Costs one look at the screen plus the wait.

Response

boolean
true when the request was carried out. Check each result for how it went on that phone.
Result[]
One Result per phone, in the order of phoneIds. With observe, each successful result also has:
A result with ok: true means the key was pressed on that phone. On Android, remote keyboard control can hide the on-screen keyboard and expand the app’s content area. Check the current screenshot before using saved touch coordinates after the layout changes.