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.
gemini-3-flash-preview(recommended)gemini-3-pro-previewgemini-2.5-flashgemini-2.5-progemini-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 finalAgentConfig object.
Complete Example
TaskDefaults Builder
Configure default settings for all tasks:Server Configuration Shortcut
Usewith_servers() as a shortcut for configuring ADB server settings:
Next Steps
Agent SDK
Learn about the Agent class
Types
Explore configuration types

