Beispiel #1
0
 protected virtual void KillServer()
 {
     lock (concurrentLock)
     {
         using var cmd = new CommandProcedure(AdbExecutableFile.ToString(), $"-P{ServerEndPoint.Port} kill-server");
         int line = 0;
         cmd.OutputReceived += (s, e) =>
         {
             line++;
             SLogger.Info(this, $"killing adb server {line}:{e.Text}");
         };
         cmd.Execute();
         SLogger.Info(this, "server killed");
     }
 }
Beispiel #2
0
        protected virtual void KillServer()
        {
            lock (concurrentLock)
            {
                using var cmd = new CommandProcedure()
                      {
                          FileName      = AdbExecutableFile.ToString(),
                          Arguments     = $"-P{ServerEndPoint.Port} kill-server",
                          DirectExecute = true,
                      };
                cmd.InitializeAdbEnvironment(AdbClientDirectory, (ushort)ServerEndPoint.Port);

                new LocalAdbServerKiller(cmd).Kill().Wait();

                SLogger.Info(this, "Adb Server has been stopped.");
            }
        }
        protected virtual IPEndPoint StartServer(ushort port = 6605)
        {
            using var cmd = new CommandProcedure()
                  {
                      FileName      = AdbExecutableFile.ToString(),
                      Arguments     = $"-P{port} start-server",
                      DirectExecute = true,
                  };
            cmd.InitializeAdbEnvironment(AdbClientDirectory, port);

            int line = 0;

            cmd.OutputReceived += (s, e) =>
            {
                line++;
                SLogger.Info(this, $"statring adb server {line}:{e.Text}");
            };
            cmd.Execute();
            return(new IPEndPoint(IPAddress.Parse("127.0.0.1"), port));
        }
        protected virtual void KillServer()
        {
            lock (concurrentLock)
            {
                using var cmd = new CommandProcedure()
                      {
                          FileName      = AdbExecutableFile.ToString(),
                          Arguments     = $"-P{ServerEndPoint.Port} kill-server",
                          DirectExecute = true,
                      };
                cmd.InitializeAdbEnvironment(AdbClientDirectory, (ushort)ServerEndPoint.Port);

                int line = 0;
                cmd.OutputReceived += (s, e) =>
                {
                    line++;
                    SLogger.Info(this, $"killing adb server {line}:{e.Text}");
                };
                cmd.Execute();
                SLogger.Info(this, "server killed");
            }
        }