Android emulator closes with telnet via appium script

I am trying to close the Android emulator using the telnet command through the Appium script, but after running the telnet command, waiting for manual input for the kill command. Failed to execute the Kill command with the Appium script.

Runtime.getRuntime().exec("telnet localhost 5554");
Process proc=  Runtime.getRuntime().exec("kill");
BufferedReader r = new BufferedReader(new  InputStreamReader(proc.getInputStream()));
       System.out.println("executed3");
       String line;
       while (true) {
           line = r.readLine();
           if (line == null) { break; }
           System.out.println(line);
       }
+4
source share
2 answers

This command line is used to automatically close the emulator through the appium script.

Runtime.getRuntime().exec("tskill emulator-arm");
+3
source
use this code
tskill emulator-arm
+1
source

Source: https://habr.com/ru/post/1608021/


All Articles