IEDA远程调试工具使用

配置IDEA

  • 选择Lua Remote(Mobdebug)进行设置

  • 端口默认为8172,如无特殊需求不建议修改。

  • realRequire("mobdebug").start("XXXX", 8172)添加到Lua代码入口处,一般默认为Init.lua中,XXXX为本地ip地址。

  • 左侧列表中选中Lua文件夹并右键-Mark Directory as-Sources Root

  • 如果准备进行远程或真机调试,则选择Lua Remote(Mobdebug)配置进行添加。
    可以将下列代码拷贝到Init.lua

local function Debug(isLocal)
    --package.cpath = package.cpath .. ';C:/Users/admin/.IntelliJIdea2018.3/config/plugins/intellij-emmylua/classes/debugger/emmy/windows/x64/?.dll'
    --local dbg = require('emmy_core')
    --dbg.tcpListen('localhost', 9966)
    if isLocal then
        package.cpath = package.cpath .. ';C:/Users/admin/AppData/Roaming/JetBrains/IntelliJIdea2021.1/plugins/EmmyLua/debugger/emmy/windows/x64/?.dll'
        local dbg = require('emmy_core')
        dbg.tcpConnect('localhost', 9966)
    else
        require("mobdebug").start("192.168.8.7", 8172)
    end
end

if _G.IsEditor then
    Logger.Info('Connect local debugger')
    --_G.tryCatch(Debug(true))
    _G.tryCatch(Debug,true)
else
    Logger.Info('Connect remote debugger')
    --Debug(false)
    _G.tryCatch(Debug,false)
end

  • 开启Debugger,Console中显示Start mobdebug server at port:8172 Waiting for process connection...表明IDE启动成功。
posted @   请明月  阅读(24)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· DeepSeek “源神”启动!「GitHub 热点速览」
· 微软正式发布.NET 10 Preview 1:开启下一代开发框架新篇章
· C# 集成 DeepSeek 模型实现 AI 私有化(本地部署与 API 调用教程)
· DeepSeek R1 简明指南:架构、训练、本地部署及硬件要求
· 2 本地部署DeepSeek模型构建本地知识库+联网搜索详细步骤
点击右上角即可分享
微信分享提示