Is there any way to trigger(start) Run/Debug configuration programmatically?

When use my plugin, I want to do some works before launch my program.


So I created a Run configuration, in there, I make some source code that i want to do..

My Run configuration is extension of application launch process, so in the end of my Run configuration I want to trigger(start) Run configuration those are commonly use (eg. Jara main() run / Application launch in android studio / etc...)

  1. (user click run/debug button with my Run configuration)
  2. In my Run configuration, show any dialog, make a file, etc...
  3. Finally, I want to trigger Android launch process(or any other run configuration)


1. Is there way to list-up Run configurations programmatically? 

2. If 1. is available, is there way to start a Run configuration of them?


Thank you for your reply in advance..

Comment actions Permalink

I found RunManager class and I can list-up run configurations!!!


So,.... Question #2 remains........

Comment actions Permalink

Maybe using com.intellij.execution.BeforeRunTaskProvider is an easier and more flexible solution? So you can add your "before the main run configuration starts, I want to perform X" tasks to *any* kind of run configuration

Comment actions Permalink

ExecutionEnvironmentBuilder builder = ExecutionEnvironmentBuilder.createOrNull(DefaultRunExecutor.getRunExecutorInstance(), settings);
if (builder != null) {



Please sign in to leave a comment.