Skip to content

Values

The small values calls return or take: an element's snapshot and bounds, an app's process, a permission prompt, a toast, a notification, the foreground activity, and Long for intent extras.

ElementSnapshot

The state of one node at one instant (Element.snapshot()). Text properties are None when the node has none. text is the raw accessibility text: on API 26+ an empty field reports its hint there and showing_hint is True.

class_name

class_name: str | None

package_name

package_name: str | None

resource_name

resource_name: str | None

text

text: str | None

content_description

content_description: str | None

hint

hint: str | None

bounds

bounds: Bounds

checkable

checkable: bool

checked

checked: bool

clickable

clickable: bool

enabled

enabled: bool

focusable

focusable: bool

focused

focused: bool

long_clickable

long_clickable: bool

scrollable

scrollable: bool

selected

selected: bool

child_count

child_count: int

showing_hint

showing_hint: bool

actions

actions: tuple[StandardAction, ...]

The standard actions the node offers (Element.perform_action).

custom_actions

custom_actions: tuple[str, ...]

The labels of the custom actions the node offers (Element.perform_custom_action).

range

range: Range | None

The node's range, when it is a range node (Element.set_progress).

Bounds

A node's bounds in screen pixels.

left

left: int

top

top: int

right

right: int

bottom

bottom: int

width

width: int

height

height: int

center

center: tuple[int, int]

Range

A range node's (SeekBar, Slider, RatingBar, ProgressBar) value and bounds, in its own units (Element.set_progress).

type

type: RangeType

min

min: float

max

max: float

current

current: float

RangeType

Bases: Enum

How a range node counts its value.

INT

INT

FLOAT

FLOAT

PERCENT

PERCENT

UNKNOWN

UNKNOWN

AppProcess

A process of an app as the host sees it: PID plus the /proc start token that tells reused PIDs apart.

pid

pid: int

start_token

start_token: str

PermissionPrompt

A runtime-permission dialog on screen (Device.await_permission_prompt): the package of its window (what in_package scopes its other elements with), the choices it offers, in PermissionChoice order, and the location accuracies it lets the user pick (empty unless it asks for precise location).

package_name

package_name: str

choices

choices: tuple[PermissionChoice, ...]

accuracies

accuracies: tuple[LocationAccuracy, ...]

Toast

A toast Device.await_toast saw: its text and the package that showed it (on Android 11+ a text toast is drawn by SystemUI but still reported under the app that posted it).

text

text: str

package_name

package_name: str

Notification

An active notification (Device.notifications, Device.await_notification): the package that posted it, its title and text (the android.title / android.text extras, None when it has none), the titles of its action buttons (what Device.open_notification's action names), whether a swipe dismisses it (False for an ongoing one, such as a foreground service's), and when it was posted (UTC).

package_name

package_name: str

title

title: str | None

text

text: str | None

actions

actions: tuple[str, ...]

clearable

clearable: bool

posted_at

posted_at: datetime

ForegroundActivity

The activity on top of the screen (Device.foreground_activity): its package and its fully qualified class name.

package_name

package_name: str

class_name

class_name: str

Long

An int sent as a 64-bit intent extra (am start --el), for an app that reads it with getLongExtra: a plain int extra is 32-bit, and getLongExtra on it returns the default. App.launch(extras={"id": Long(42)}).

value

value: int