Skip to main content
The AgentConfigBuilder provides a fluent interface for configuring agent behavior, device connections, and server settings.

Import

Methods

for_device

Specify a target device instead of auto-detection.
DevicePlatform
required
Device platform (DevicePlatform.ANDROID or DevicePlatform.IOS)
str
required
Device identifier (from adb devices or idevice_id -l)

for_cloud_mobile

Configure the agent to use a cloud mobile (virtual device hosted on Minitap Platform). When using a cloud mobile, all agentic logic runs in the cloud, and tasks are executed remotely via the Platform API.
str
required
The cloud mobile identifier. Can be either:
  • UUID (e.g., "550e8400-e29b-41d4-a716-446655440000")
  • Reference name (e.g., "my-test-device")

Example with UUID

Example with Reference Name

Important Notes:
  • for_cloud_mobile() and for_device() are mutually exclusive
  • Cloud mobiles require a Minitap API key (passed to agent.init() or via MINITAP_API_KEY env var)
  • Cloud mobiles only support PlatformTaskRequest (not TaskRequest)
  • No local setup required - no ADB, idb, or local servers needed
Cloud mobiles are ideal when you want:
  • No local device setup or maintenance
  • Centralized execution and monitoring via Minitap Platform
  • Scalable automation without managing infrastructure

add_profile

Add a single agent profile.

add_profiles

Add multiple agent profiles at once.

with_default_profile

Set the default agent profile used for tasks.
str | AgentProfile
required
Profile name (if already added) or AgentProfile instance

with_adb_server

Set the ADB server host and port.
str
required
ADB server host address
int
default:5037
ADB server port (default: 5037)

with_default_task_config

Set default configuration for all tasks created by the agent.

with_video_recording_tools

Enable video recording tools (start_video_recording, stop_video_recording). When enabled, the agent can record the device screen and analyze video content using Gemini models. This is useful for transcribing video content playing on the screen.
Requirements:
  1. ffmpeg must be installed on the system (for video compression)
  2. A video-capable model must be configured in utils.video_analyzer
Supported models for video_analyzer:
  • gemini-3-flash-preview (recommended)
  • gemini-3-pro-preview
  • gemini-2.5-flash
  • gemini-2.5-pro
  • gemini-2.0-flash
Raises FFmpegNotInstalledError if ffmpeg is not installed. Raises ValueError at runtime if any profile lacks video_analyzer config.

build

Build and return the final AgentConfig object.

Complete Example

TaskDefaults Builder

Configure default settings for all tasks:

Server Configuration Shortcut

Use with_servers() as a shortcut for configuring ADB server settings:

Next Steps

Agent SDK

Learn about the Agent class

Types

Explore configuration types