cocos_start_preview
Start a local HTTP server to preview Cocos Creator game builds in a browser after compilation. Specify project path, platform, and port to launch the preview.
Instructions
Start a local HTTP server serving the build// directory.
Returns {port, url, serving}. Idempotent — replaces any server
already on port. Run cocos_build first.
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": {
"project_path": "<project_path>"
},
"name": "cocos_start_preview"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_path | Yes | ||
| platform | No | web-mobile | |
| port | No |