You can or add it programmatically, or just put files under the .idea/runConfigurations
directory (the easiest way).
To add programmatically:
RunManagerImpl manager = RunManagerImpl.getInstanceImpl(project)
RunnerAndConfigurationSettingsImpl settings = new RunnerAndConfigurationSettingsImpl(manager);
// data it is something like JDOMUtil.load(file)
settings.readExternal(data)
manager.add(settings, false)
I didn't test this code, but should be like this.
More easy and robust way will be in the 2017.2.
Thank you very much for the super quick reply. If I may ask another question, how to you set options directly?