Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android emulator close using telnet via appium script

I am trying to close Android emulator using telnet command via Appium script but after executing the telnet command waiting for manual input for "kill" command. Unable to execute the "Kill" command along with 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);
       }
like image 556
bcrajkumar Avatar asked Sep 27 '22 17:09

bcrajkumar


2 Answers

This command line use for close the emulator automatically via appium script.

Runtime.getRuntime().exec("tskill emulator-arm");
like image 171
anbu Avatar answered Oct 17 '22 18:10

anbu


use this code
tskill emulator-arm
like image 1
Baskar .A Avatar answered Oct 17 '22 19:10

Baskar .A