A while ago I had to remotely debug client side code of a GWT application already compiled and deployed onto a server. After searching around and reading this document a few times, I finally managed to do it following these steps:
- Compile and install the application on the server and write down the URL (like http://remote.host:8080/myapp/index.jsp).
- Create an Application launcher (Run->Edit Configurations->Applications in IntelliJ).
- Set the main class to: com.google.gwt.dev.DevMode
- Put this line in the program arguments: -noserver -war target/myapp -logLevel DEBUG -startupUrl http://remote.host:8080/myapp/index.jsp -port 8080 my.package.myapp.Module
- Debug this new run configuration. This will run the GWT Dev Mode and enable you to set breakpoints on the client side code.
- Copy and paste URL provided by Dev Mode into your browser (like http://remote.host:8080/myapp/indexjsp?gwt.codesvr=127.0.0.1:9997). You will need to modify Dev Mode extension options to allow this new combination (of app server and code server). On Chrome, for example, you can do this by clicking on the greyed out Dev Mode logo if you get an error.
- Remotely debug the server in the normal way (JDWP) to be able to debug server-side code as well.