首先把agent打成jar包
然后在主项目中,导入agent。要使用 IntelliJ IDEA 的菜单 File / New / Module 或 File / New / Module from Existing Sources ,保证主项目和 Agent 项目平级。
在VM options里填写:-javaagent: /agent路径/agent.jar
如果有多个参数要填,空格隔开就行了
然后debug模式就可以同时调试主程序和agent了
首先把agent打成jar包
然后在主项目中,导入agent。要使用 IntelliJ IDEA 的菜单 File / New / Module 或 File / New / Module from Existing Sources ,保证主项目和 Agent 项目平级。
在VM options里填写:-javaagent: /agent路径/agent.jar
如果有多个参数要填,空格隔开就行了
然后debug模式就可以同时调试主程序和agent了