public IProcessAsyncOperation Execute(ExecutionCommand command, IConsole console) { var cmd = (MeeGoExecutionCommand)command; var targetDevice = MeeGoDevice.GetChosenDevice(); if (targetDevice == null) { return(new NullProcessAsyncOperation(false)); } //if (MeeGoUtility.NeedsUploading (cmd.Config)) { MeeGoUtility.Upload(targetDevice, cmd.Config, console.Out, console.Error).WaitForCompleted(); //} var auth = GetGdmXAuth(targetDevice); if (auth == null) { console.Error.WriteLine("Could not obtain single X authority for user '" + targetDevice.Username + "'"); return(new NullProcessAsyncOperation(false)); } var proc = CreateProcess(cmd, null, targetDevice, auth, console.Out.Write, console.Error.Write); proc.Run(); return(proc); }
void StartProcess(MeeGoSoftDebuggerStartInfo dsi) { MeeGoUtility.Upload(dsi.Device, dsi.ExecutionCommand.Config, null, null).WaitForCompleted(); var auth = MeeGoExecutionHandler.GetGdmXAuth(dsi.Device); string debugOptions = string.Format("transport=dt_socket,address={0}:{1}", dsi.Address, dsi.DebugPort); process = MeeGoExecutionHandler.CreateProcess(dsi.ExecutionCommand, debugOptions, dsi.Device, auth, x => OnTargetOutput(false, x), x => OnTargetOutput(true, x)); process.Completed += delegate { process = null; }; TargetExited += delegate { EndProcess(); }; process.Run(); }