IntelliJ IDEA 2018.2 Help

Attach to Process

The Attach to process feature allows you to debug a project which you are developing in IntelliJ IDEA, but that you are unable to launch directly from your IDE for some reason.

The process intended for debugging can be launched from your operating system, or using the IntelliJ IDEA terminal. In either way, it should be launched in the debug mode using the following startup parameters:

-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5009

Attach to a process

  1. From the main menu, choose Run | Attach to Process or press Ctrl+Alt+F5.
  2. From the list of available processes, select the desired process.
    ij attachToProcess
    Simplify your search by typing the first letters of its name or PID. If there are several debuggers that can be used for the selected process, you can choose among them in the pop-up menu.
  3. Proceed with debugging the same way as you usually do it in IntelliJ IDEA (set breakpoints, step through, pause and resume the process, evaluate expressions, etc.) Note that in case the process you have attached to does not provide debug information, breakpoints will be unavailable and stepping will be performed in the disassembly view.
  4. When finished, detach the process: select the Run | Stop or click the Stop the process button icons actions suspend svg of the Debug Tool Window.
Last modified: 4 September 2018

See Also