Android 模拟器通过 appium 脚本使用 telnet 关闭 [英] Android emulator close using telnet via appium script

查看:29
本文介绍了Android 模拟器通过 appium 脚本使用 telnet 关闭的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图通过 Appium 脚本使用 telnet 命令关闭 Android 模拟器,但在执行 telnet 命令后等待手动输入kill"命令.无法与 Appium 脚本一起执行Kill"命令.

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);
       }

推荐答案

此命令行用于通过 appium 脚本自动关闭模拟器.

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

Runtime.getRuntime().exec("tskill emulator-arm");

这篇关于Android 模拟器通过 appium 脚本使用 telnet 关闭的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆