Skip to main content

Revyl CLI - AI-powered mobile app testing

Project description

Revyl Device SDK

Python SDK for programmatic control of Revyl cloud devices. Start sessions, interact with elements, run live test steps, and capture screenshots.

Install

pip install revyl

Authenticate

revyl auth login                # Browser-based login
export REVYL_API_KEY="rev_..."  # Or set an API key

Quick Start

from revyl import DeviceClient

device = DeviceClient.start(platform="ios", timeout=600)

device.tap(target="Login button")
device.type_text(target="Email", text="user@example.com")
device.type_text(target="Password", text="secret123")
device.tap(target="Submit")
device.validation("Verify the dashboard title is visible")
device.screenshot(out="after-login.png")

device.stop_session()

Context Manager (Auto Stop)

from revyl import DeviceClient

with DeviceClient.start(platform="android") as device:
    device.tap(target="Get Started")
    device.swipe(target="feed", direction="down")

Binary Resolution

The SDK resolves the CLI binary in this order:

  1. SDK-managed binary at ~/.revyl/bin/ (with valid checksum)
  2. revyl on PATH
  3. Auto-download from GitHub releases

Use RevylCLI(binary_path="...") to override.

API Reference

RevylCLI

from revyl import RevylCLI

cli = RevylCLI()                                    # Auto-resolved binary
cli = RevylCLI(binary_path="/usr/local/bin/revyl")  # Explicit path

version = cli.run("version")                        # Returns stdout string
sessions = cli.run("device", "list", json_output=True)  # Returns parsed JSON

Raises RevylError on non-zero exit code.

DeviceClient

Session Management

Method Signature Description
start (cls, platform, timeout=None, open_viewer=False, app_id=None, build_version_id=None, app_url=None, app_link=None, cli=None) -> DeviceClient Class method. Start a session and return a client.
start_session (platform, timeout=None, open_viewer=False, app_id=None, build_version_id=None, app_url=None, app_link=None) -> dict Start a device session.
stop_session (session_index=None) -> dict Stop a session.
stop_all () -> dict Stop all sessions.
list_sessions () -> list[dict] List active sessions.
use_session (index: int) -> str Switch active session.
info (session_index=None) -> dict Get session details.
doctor (session_index=None) -> str Run session diagnostics (text output).
close () -> None Best-effort stop for tracked session.

Actions

Method Signature Description
tap (target=None, x=None, y=None, session_index=None) -> dict Tap an element.
double_tap (target=None, x=None, y=None, session_index=None) -> dict Double-tap.
long_press (target=None, x=None, y=None, duration_ms=1500, session_index=None) -> dict Long press.
type_text (text, target=None, x=None, y=None, clear_first=True, session_index=None) -> dict Type text.
swipe (direction, target=None, x=None, y=None, duration_ms=500, session_index=None) -> dict Swipe gesture.
drag (start_x, start_y, end_x, end_y, session_index=None) -> dict Drag (coordinates only).
pinch (target=None, x=None, y=None, scale=2.0, duration_ms=300, session_index=None) -> dict Pinch/zoom.
clear_text (target=None, x=None, y=None, session_index=None) -> dict Clear text in a field.

Controls

Method Signature Description
back (session_index=None) -> dict Android back button.
key (key: str, session_index=None) -> dict Press ENTER or BACKSPACE.
shake (session_index=None) -> dict Shake gesture.
wait (duration_ms=1000, session_index=None) -> dict Fixed wait.
go_home (session_index=None) -> dict Return to home screen.
open_app (app: str, session_index=None) -> dict Open a system app.
navigate (url: str, session_index=None) -> dict Open URL or deep link.
set_location (latitude: float, longitude: float, session_index=None) -> dict Set GPS location.
download_file (url: str, filename=None, session_index=None) -> dict Download file to device.

App Management

Method Signature Description
install_app (app_url: str, bundle_id=None, session_index=None) -> dict Install from URL.
launch_app (bundle_id: str, session_index=None) -> dict Launch by bundle ID.
kill_app (session_index=None) -> dict Kill the current app.

Live Steps

Method Signature Description
instruction (description: str, session_index=None) -> dict Execute one instruction step.
validation (description: str, session_index=None) -> dict Execute one validation step.
extract (description: str, variable_name=None, session_index=None) -> dict Execute one extract step.
code_execution (script_id: str, session_index=None) -> dict Execute one code-execution step.

Capture

Method Signature Description
screenshot (out=None, session_index=None) -> dict Take a screenshot.

Beyond Device Control

For test execution, workflow management, and builds, use the revyl CLI directly or RevylCLI.run():

cli = RevylCLI()
cli.run("test", "run", "login-flow", json_output=True)
cli.run("workflow", "run", "smoke-tests", json_output=True)

Targeting

All action methods support either:

  • Grounded targeting via target="..." (recommended), or
  • Raw coordinates via x=... and y=...

Provide one or the other, not both.

Error Handling

from revyl import DeviceClient, RevylError

try:
    device = DeviceClient.start(platform="ios")
    device.tap(target="Login")
except RevylError as e:
    print(f"Failed: {e}")

Repo Smoke Script

From the repo root:

make device-prod-sdk-smoke-ios
make device-prod-sdk-smoke-android

Useful variants:

make device-prod-sdk-smoke-ios ARGS="--grounded-text"
make device-prod-sdk-smoke-ios ARGS="--app-url https://... --bundle-id com.example.app"
make device-prod-sdk-smoke-android ARGS="--grounded-text"
make device-prod-sdk-smoke ARGS="--platform android"

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

revyl-0.1.11.tar.gz (24.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

revyl-0.1.11-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

Details for the file revyl-0.1.11.tar.gz.

File metadata

  • Download URL: revyl-0.1.11.tar.gz
  • Upload date:
  • Size: 24.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for revyl-0.1.11.tar.gz
Algorithm Hash digest
SHA256 376128cea58202cdf88a616e10800a17fce9a1b13d8fb7ef9361a4b1a02394df
MD5 de764d7b8f1f6334397f9fbc20825b49
BLAKE2b-256 80394f93a54a593b218e63b3ce23ee0fbbc2f2918d437ea9edf6e875d759783d

See more details on using hashes here.

File details

Details for the file revyl-0.1.11-py3-none-any.whl.

File metadata

  • Download URL: revyl-0.1.11-py3-none-any.whl
  • Upload date:
  • Size: 10.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for revyl-0.1.11-py3-none-any.whl
Algorithm Hash digest
SHA256 217e947478069c6bf3d64ad1373f5fa1bc51f8f9e9983f110f97b0b866fcf905
MD5 d5af23ce3f64009f010b86f78b17b282
BLAKE2b-256 28dcba2ab8cd68087fcf4dc2dc7f95a61b7c5c1415ce899ffd12aa8a7d229589

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page