Debugging two instances of the same project simultaneously

已回答

I'm trying to debug two instances of the same project simultaneously. I have this "worker" project which in real life there might be a number of them running all at the same time. Right now I'm testing some scenarios to make sure there won't be any concurrency problems.

The problem I've got is that I can not open the same project twice. Even though I can press the start debug button twice to start two instances of the same project, but they will share the same code and the same break points, while I'm interested to have different break points for each of the instances.

What's the workaround here? How can I debug two instances of the same project without them interfering with each other?

3

Since the breakpoints are stored per project, you will need to set up a second project in a different location, but then add the same modules from the original project (import .iml files) to this new project. This way you will have 2 different projects with .idea folder located in different places, but sharing the same modules and content roots.

0

Thanks but don't you find that a little too much for such a simple need? I'm not saying that there is a better way but there should be! Or it least it should be automated.

Thanks anyway.

1

Maybe breakpoint groups that depend on the run/debug configuration would help? Feature request is welcome at https://youtrack.jetbrains.com/issues/IDEA.

1
Avatar
Permanently deleted user

Hello Mehran, I hope you are doing well. Did you find a workaround for this scenario? I'm having the same issue. :(

1

请先登录再写评论。