Esempio n. 1
0
        private void CheckAdbPort()
        {
            List <String> list = AdbUtils.exeCommandForList(FIND_PORT_5037);
            List <String> pids = new List <String>();

            foreach (String line in list)
            {
                String[] array = Regex.Split(line.Trim(), "\\s+", RegexOptions.IgnoreCase);
                if (array.Length == 5 && array[1] == "127.0.0.1:5037")
                {
                    String pid = array[4];
                    if (!pids.Contains(pid))
                    {
                        pids.Add(pid);
                    }
                }
            }
            foreach (String pid in pids)
            {
                if (pid != "0")
                {
                    AdbUtils.exeCommandForList(KILL_PID.Replace("pid", pid));
                }
            }
            AdbUtils.exeCommand(START_ADB);
        }
Esempio n. 2
0
 private void StartApp()
 {
     AdbUtils.exeCommand(START_APP);
     AdbUtils.exeCommand(START_ACCESSIBILITY_SERVICE);
 }
Esempio n. 3
0
 private void StartAdbPort()
 {
     AdbUtils.exeCommand(START_ADB_FORWARD);
     AdbUtils.exeCommand(START_ADB_REVERSE);
 }