启动自动化并连接模拟器
wdt_auto_startStarts a WeChat DevTools automation session by opening the mini program project, enabling the automation port, and connecting over WebSocket so page, query, element, and screenshot tools can run.
Instructions
通过 CLI auto 打开项目并开启自动化端口,然后建立 WebSocket 连接。需要服务端口开启。后续 wdt_current_page / wdt_query / wdt_element / wdt_screenshot 等工具依赖此连接。
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": "wdt_auto_start"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| port | No | 自动化端口,默认 9420 | |
| restart | No | 强制重启自动化;默认复用已连接会话,避免打断现有窗口 | |
| timeoutMs | No | 等待端口与连接的总预算,默认 45000,最大 45000 | |
| projectPath | No | 小程序项目目录;省略时使用 WECHAT_DEVTOOLS_PROJECT |