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()andfor_device()are mutually exclusive- Cloud mobiles require a Minitap API key (passed to
agent.init()or viaMINITAP_API_KEYenv var) - Cloud mobiles only support
PlatformTaskRequest(notTaskRequest) - No local setup required - no ADB, idb, or local servers needed
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

