Connect Webview
webview_connectConnects to an app's in-app WebView via adb forwarding, returning the current page URL, title, and route. Call this before accessing WebView DOM.
Instructions
连接/重连目标 App 的 in-app 系统 WebView(自动 adb forward),返回当前页 url/title/路由。读 webview DOM 前必须先调它。
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"device": "<device>",
"packageName": "<packageName>"
},
"name": "webview_connect"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| port | No | 本地转发端口,默认 9222 | |
| device | Yes | 目标设备 serial(同 mobile_list_available_devices 的 id) | |
| packageName | Yes | App 包名(其 webview 被调试),如 cn.csxs.xiaoshuo |