Search code examples
zerobrane

Automatically start debugger server when ZeroBrane starts


How to make ZeroBrane to automatically initiate the debugger server on startup?

I have embedded Lua in a C++ application. I would like to debug the Lua scripts using ZeroBrane. The C++ application launches ZeroBrane, call mobdebug.start(), but then the user has to go to Project->Start Debugger Server manually. Can ZeroBrane be configured so that it starts the server when the IDE launches?

Thanks in advance,


Solution

  • ok, I think I solved it. I just added:

    local debugger = ide:GetDebugger()
    debugger:Listen(true)
    

    inside the postinit = function () in the zbstudio/app.lua file.