Start a session on one of your organization’s phones, then drive it with the same calls as a page or a computer: locators, the keyboard and screenshots.
1

Connect

import halyard

client = halyard.Client()  # reads HALYARD_API_KEY
session = client.phones.create()
try:
    phone = session.connect()
    hello = phone.handshake()
    print(hello.device.model, hello.has_domain("Accessibility"))
    ...  # the steps below
finally:
    session.stop()  # releases the phone
Inside a Halyard sandbox, where the phone is already allocated, use halyard.Phone.connect() with no arguments instead.
2

Find and tap

phone.get_by_text("Settings").click()
phone.get_by_role("button", name="Network & internet").click()
click() taps on a phone; tap() is the same call.Text matches against the accessibility tree when the phone has one, and by OCR otherwise. Roles need the tree. Each call waits on the phone until the target is there and ready, up to 5 seconds; pass timeout= in milliseconds to change it.
3

Type

phone.get_by_text("Search").fill("wifi")
phone.keyboard.press("Enter")
4

Read the screen

screen = phone.observe()
for el in screen.texts:
    print(el.text, el.center)

phone.screenshot(path="screen.png")
5

Act at a point

phone.touchscreen.swipe(540, 1600, 540, 600)   # scroll down

hit = phone.observe().find_text("Wi-Fi")
if hit:
    phone.touchscreen.tap(hit.center["x"], hit.center["y"])
Points are screen pixels, the same space as observe() and screenshot().

When nothing has text

Describe it instead. A query locator is resolved by a vision model:
phone.locator(query="the magnifying glass icon at the top").tap()

Next steps

Phone

Every method on Phone.

Locator

Strategies, refining and waiting.