在需要远程debug的项目中必须在class编译阶段就加入调试信息,gradle文件中加入以下内容 tasks.withType(JavaCompile){ options.compileArgs += "-g" }