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)

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