Search code examples
powershelljetbrains-iderider

Attach to Rider debugger through command line


I am looking for a way to attach the debugger in Rider through CLI. I noticed that when the debugger attaches, it emits the following

C:\Users\USERNAME\AppData\Local\JetBrains\Toolbox\apps\Rider\ch-1\173.3994.2442\bin\runnerw.exe C:\Users\USERNAME\AppData\Local\JetBrains\Toolbox\apps\Rider\ch-1\173.3994.2442\lib\ReSharperHost\JetBrains.Debugger.Worker64.exe 61962

I wrote a PowerShell script that mimics the output above but executing it didn't attach the debugger. I tried looking for help commands on those two executables but nothing returned.

Does anyone know if this is possible?


Solution

  • this is actually supported today, see https://www.jetbrains.com/help/rider/Working_with_the_IDE_Features_from_Command_Line.html#arguments

    for example:

    PID=$(ps aux | grep -v grep | grep 'dotnet exec .*/Mugen.dll' | tr -s ' ' | cut -d' ' -f2)
    rider attach-to-process $PID Mugen.sln