Getting Started

From install to first breakpoint

Install → sign in → copy runtime → launch.json → start debugger before the game.

1. Install

  1. Install LuaDebug from the Cursor / VS Code marketplace.
  2. Open your Lua script folder only (indexing a whole game/engine tree is slow).
  3. Disable other type=lua debugger extensions (e.g. old LuaIde) so the Add Configuration list stays correct.

2. Register & sign in

  1. Open the LuaDebug activity bar.
  2. Register with email and complete verification.
  3. 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.

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

  1. Open Run and Debug.
  2. No .vscode/launch.json → Create launch.json → pick LuaDebug.
  3. Existing → Add Configuration… → pick a LuaDebug: snippet.
  4. Set localRoot and port; for Cocos launch also exePath (and commandLine if 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

  1. Set breakpoints on Lua source lines.
  2. First start the editor debugger (it listens on the port).
  3. Then start the game / client so StartDebug runs.
  4. On hit you can inspect variables, the call stack, and step (F10 / F11, etc.).