set_animation_scale
Adjust Android device animation speed for UI testing by setting scale values (0=off, 1=normal, 0.5=fast) to control visual transitions during development workflows.
Instructions
Set animation scale (0 = off, 1 = normal, 0.5 = fast). Useful for speeding up UI tests.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "set_animation_scale"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| scale | No | ||
| device_serial | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- src/adb_mcp_server/server.py:890-901 (handler)The main handler function for the 'set_animation_scale' tool. It sets the window, transition, and animator animation scales on the Android device using ADB shell settings commands. The @mcp.tool() decorator registers it as an MCP tool.
@mcp.tool() def set_animation_scale(scale: float = 1.0, device_serial: str | None = None) -> str: """ Set animation scale (0 = off, 1 = normal, 0.5 = fast). Useful for speeding up UI tests. """ scale_str = str(scale) run_adb(["shell", "settings", "put", "global", "window_animation_scale", scale_str], device_serial) run_adb(["shell", "settings", "put", "global", "transition_animation_scale", scale_str], device_serial) run_adb(["shell", "settings", "put", "global", "animator_duration_scale", scale_str], device_serial) return f"Animation scale set to {scale}"