use of com.intellij.execution.configurations.GeneralCommandLine in project android by JetBrains.
the class Haxm method getMacHaxmCommandLine.
private static GeneralCommandLine getMacHaxmCommandLine(File path) throws WizardException {
// The new executable now requests admin access and executes the shell script. We need to make sure both exist and
// are executable.
ensureExistsAndIsExecutable(path, "silent_install.sh");
File executable = ensureExistsAndIsExecutable(path, "HAXM installation");
return new GeneralCommandLine(executable.getAbsolutePath()).withWorkDirectory(path);
}
use of com.intellij.execution.configurations.GeneralCommandLine in project android by JetBrains.
the class CheckSdkOperation method checkCanRunSdkTool.
private static boolean checkCanRunSdkTool(File executable) throws ExecutionException {
GeneralCommandLine commandLine = new GeneralCommandLine(executable.getAbsolutePath());
CapturingAnsiEscapesAwareProcessHandler handler = new CapturingAnsiEscapesAwareProcessHandler(commandLine);
final int exitCode = handler.runProcess().getExitCode();
// 1 means help was printed
return exitCode == 1;
}
use of com.intellij.execution.configurations.GeneralCommandLine in project android by JetBrains.
the class AccelerationErrorSolution method promptAndReboot.
/**
* Prompts the user to reboot now, and performs the reboot if accepted.
* HAXM Installer may need a reboot only on Windows, so this method is intended to work only on Windows
* and only for HAXM installer use case
*
* @param prompt the message to display to the user
* @exception ExecutionException if the shutdown command fails to execute
* @return No return value
*/
public static void promptAndReboot(@NotNull String prompt) throws ExecutionException {
int response = Messages.showOkCancelDialog((Project) null, prompt, "Reboot Now", Messages.getQuestionIcon());
if (response == Messages.OK) {
GeneralCommandLine reboot = new ElevatedCommandLine();
reboot.setExePath("shutdown");
// shutdown & restart after a 10 sec delay
reboot.addParameters("/g", "/t", "10");
reboot.setWorkDirectory(FileUtilRt.getTempDirectory());
execute(reboot);
}
}
use of com.intellij.execution.configurations.GeneralCommandLine in project android by JetBrains.
the class AccelerationErrorSolution method generateCommand.
private static GeneralCommandLine generateCommand(@NotNull String command, String... parameters) {
GeneralCommandLine commandLine = new GeneralCommandLine();
commandLine.setExePath(command);
commandLine.addParameters(parameters);
return commandLine;
}
use of com.intellij.execution.configurations.GeneralCommandLine in project android by JetBrains.
the class AndroidRunDdmsAction method doRunTool.
@Override
protected void doRunTool(@NotNull final Project project, @NotNull final String sdkPath) {
if (getDdmsProcessHandler() != null) {
Messages.showErrorDialog(project, AndroidBundle.message("android.launch.ddms.already.launched.error"), CommonBundle.getErrorTitle());
return;
}
final boolean adbServiceEnabled = AndroidEnableAdbServiceAction.isAdbServiceEnabled();
if (adbServiceEnabled && !AndroidEnableAdbServiceAction.disableAdbService(project)) {
return;
}
final String toolPath = sdkPath + File.separator + AndroidCommonUtils.toolPath(getDdmsCmdName());
final GeneralCommandLine commandLine = new GeneralCommandLine();
commandLine.setExePath(toolPath);
LOG.info(commandLine.getCommandLineString());
ApplicationManager.getApplication().executeOnPooledThread(new Runnable() {
@Override
public void run() {
doLaunchDdms(commandLine, project, adbServiceEnabled);
}
});
}
Aggregations