Lua Debugger

Local Lua Debugger

For debugging with Local Lua Deubgger, launch.json should be placed in your workspace folder. For instance,

Assuming Kwik projects are located in ~/Kwik folder and this is your workplace folder of Visual Studio Code. launch.json will be created under .vscode/ folder

  • ~/Kwik/.vscode/launch.json

    Corona Simulator.app is specified and ${file} is in the last argurment

    this is for Mac

      "version": "0.2.0",
      "configurations": [
        {
          "name": "Debug",
          "type": "lua-local",
          "request": "launch",
            "program": {
              "command": "/Applications/Corona/Corona Simulator.app/Contents/MacOS/Corona Simulator",
            },
            "args": [
              "-no-console"
              "YES"
              "-debug"
              "1"
              "-project"
              "${file}"
            ]
        }
      ]
    }

    for Windwos

    {
    "version": "0.2.0",
    "configurations": [{
        "name": "Debug",
        "type": "lua-local",
        "request": "launch",
          "program": {
            "command": "C:\\Program Files (x86)\\Corona Labs\\Corona\\Corona Simulator.exe",
          },
          "args": [
            "/no-console",
            "/debug",
            "${file}"
          ]
      }]
    }
  • SingleBook project contains Photsohop/book/*.psd and lua files under Solar2D/src folder

    • ~/Kwik/SingleBook/Solar2D/src/main.lua
  • open main.lua in Visual Studio Code and press F5 (Run > Start Debugging)

    main.lua needs lldebugger.start()

    if os.getenv("LOCAL_LUA_DEBUGGER_VSCODE") == "1" then
      local lldebugger = loadfile(os.getenv("LOCAL_LUA_DEBUGGER_FILEPATH"))()
      lldebugger.start()
    end