1. Install
- Install LuaDebug from the Cursor / VS Code marketplace.
- Open your Lua script folder only (indexing a whole game/engine tree is slow).
- Disable other type=
luadebugger extensions (e.g. old LuaIde) so the Add Configuration list stays correct.
2. Register & sign in
- Open the LuaDebug activity bar.
- Register with email and complete verification.
- Sign in to unlock language hints and debugging.
Forgot password: use “Forgot password” in the activity bar. Default luadebug.serverUrl is https://luadebug.walterspace.com.
3. Copy debug runtime
Runtime files live in the extension luadebug folder. After install or updating the extension, copy them again into a path the game can load.
LuaDebug.lua— PUC-Rio LuaLuaDebugjit.lua— LuaJIT (typical Cocos / Unity hot-update setups)- OpenResty build — see Frameworks
Require it early in the game startup flow, for example:
local breakSocketHandle, debugXpCall = require("LuaDebugjit")("127.0.0.1", 7003)
host / port must match launch. On a real device, host is your PC’s LAN IP, not 127.0.0.1. On Cocos, schedule breakSocketHandle — see Frameworks.
4. Configure launch
- Open Run and Debug.
- No
.vscode/launch.json→ Create launch.json → pick LuaDebug. - Existing → Add Configuration… → pick a
LuaDebug:snippet. - Set
localRootandport; for CocoslaunchalsoexePath(andcommandLineif needed).
LuaDebug missing from the list: enable the extension, sign in, disable other type=lua debuggers, then reload the window.
See Debug and Frameworks.
5. Start debugging
- Set breakpoints on Lua source lines.
- First start the editor debugger (it listens on the port).
- Then start the game / client so StartDebug runs.
- On hit you can inspect variables, the call stack, and step (F10 / F11, etc.).