Search in sources :

Example 1 with RemoteConfigurationType

use of com.intellij.execution.remote.RemoteConfigurationType in project android by JetBrains.

the class AndroidJavaDebugger method attachToClient.

@Override
public void attachToClient(@NotNull Project project, @NotNull Client client) {
    String debugPort = getClientDebugPort(client);
    String runConfigName = String.format(RUN_CONFIGURATION_NAME_PATTERN, debugPort);
    // Try to find existing debug session
    if (hasExistingDebugSession(project, debugPort, runConfigName)) {
        return;
    }
    // Create run configuration
    RemoteConfigurationType remoteConfigurationType = RemoteConfigurationType.getInstance();
    ConfigurationFactory factory = remoteConfigurationType.getFactory();
    RunnerAndConfigurationSettings runSettings = RunManager.getInstance(project).createRunConfiguration(runConfigName, factory);
    RemoteConfiguration configuration = (RemoteConfiguration) runSettings.getConfiguration();
    configuration.HOST = "localhost";
    configuration.PORT = debugPort;
    configuration.USE_SOCKET_TRANSPORT = true;
    configuration.SERVER_MODE = false;
    ProgramRunnerUtil.executeConfiguration(project, runSettings, DefaultDebugExecutor.getDebugExecutorInstance());
}
Also used : RemoteConfiguration(com.intellij.execution.remote.RemoteConfiguration) ConfigurationFactory(com.intellij.execution.configurations.ConfigurationFactory) RunnerAndConfigurationSettings(com.intellij.execution.RunnerAndConfigurationSettings) RemoteConfigurationType(com.intellij.execution.remote.RemoteConfigurationType)

Example 2 with RemoteConfigurationType

use of com.intellij.execution.remote.RemoteConfigurationType in project buck by facebook.

the class AndroidDebugger method createRunConfiguration.

private static RunnerAndConfigurationSettings createRunConfiguration(Project project, String debugPort) {
    final RemoteConfigurationType remoteConfigurationType = RemoteConfigurationType.getInstance();
    final ConfigurationFactory factory = remoteConfigurationType.getFactory();
    final RunnerAndConfigurationSettings runSettings = RunManager.getInstance(project).createRunConfiguration(getRunConfigurationName(debugPort), factory);
    final RemoteConfiguration configuration = (RemoteConfiguration) runSettings.getConfiguration();
    configuration.HOST = "localhost";
    configuration.PORT = debugPort;
    configuration.USE_SOCKET_TRANSPORT = true;
    configuration.SERVER_MODE = false;
    return runSettings;
}
Also used : RemoteConfiguration(com.intellij.execution.remote.RemoteConfiguration) ConfigurationFactory(com.intellij.execution.configurations.ConfigurationFactory) RunnerAndConfigurationSettings(com.intellij.execution.RunnerAndConfigurationSettings) RemoteConfigurationType(com.intellij.execution.remote.RemoteConfigurationType)

Aggregations

RunnerAndConfigurationSettings (com.intellij.execution.RunnerAndConfigurationSettings)2 ConfigurationFactory (com.intellij.execution.configurations.ConfigurationFactory)2 RemoteConfiguration (com.intellij.execution.remote.RemoteConfiguration)2 RemoteConfigurationType (com.intellij.execution.remote.RemoteConfigurationType)2