前提
根据VSCode配置调试环境 | Cocos 文档配置VSCode调试环境。
问题
Cocos Creator项目在VSCode中运行F5调试时报找不到浏览器
Unable to launch browser:"Unable to find an installation of the browser on your
system.Try installing it,or providing an absolute path to the browser in the
"runtimeExecutable"in your launch.json."
解决方法
在launch.json
中添加runtimeExecutable
配置浏览器绝对路径:
{
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Cocos Creator Launch Chrome against localhost",
"url": "http://localhost:7456",
"webRoot": "${workspaceFolder}",
// 提供浏览器绝对路径
"runtimeExecutable": "C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe"
}
]
}