v1.0 Stable

MAS Python SDK

Automate Android emulators with Python. Click, swipe, read text, find images on screen, and manage apps — all from a clean, type-safe API.

Built into Macro Automation Studio
// No installation needed — just open the Code Editor in MAS and start writing:
import mas
mas.click(150, 300)

Quick Example

login_automation.py
import mas
from mas import KeyCode, Region

# Device is auto-connected by MAS — no setup needed
device = mas.get_device_info()
print(f"Connected to {device.name}")

# Open an app
mas.open_app("com.example.app")

# Wait for login screen to appear
login = mas.wait_for_object(101, timeout_ms=10000)
if login:
    mas.click(150, 200)
    mas.input_text("user@example.com")

    mas.click(150, 300)
    mas.input_text("password123")

    # Click login button
    mas.click(*login.center)

# Read welcome message
result = mas.read_text(region=Region(x1=50, y1=100, x2=500, y2=150))
print(f"Welcome: {result.text}")

SDK Capabilities

Category Functions
Device get_screen_size() get_device_info()
Interaction click() swipe() input_text() key_press()
Vision find_object() read_text() take_screenshot() wait_for_object()
Apps open_app() close_app() get_current_app()

Popular Guides