安装插件luaide,免费版可使用luaide-lite
选择调试--配置
"version": "0.2.0",
"configurations": [
{
"name": "Cocos2-launch",
"type": "lua",
"request": "launch",
"runtimeType": "Cocos2",
"localRoot": "${workspaceRoot}",
"commandLine": "-workdir ${workspaceRoot}/../ -file src/main.lua",
"port": 7003,
// 此处填写exe路径
"exePath": "${workspaceRoot}/../runtime/win32/SimpleGame.exe",
"printType": 1
},
完成,接下来就可以开启调试了。