本文介绍了如何使用 JAVA 和 ADB 命令在 Appium 中检查键盘是否打开的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
限时送ChatGPT账号..我正在尝试检查 android 默认键盘是否打开.我在 Appium 中没有找到任何可以使用 JAVA 和 ADB 命令检查键盘的内容.
I am trying to check, if android default keyboard is open or not. I did not find anything to check keyboard using JAVA and ADB command in Appium.
推荐答案
我找到了这个 ADB 命令来检查键盘是否打开.
I have found this ADB command to check keyboard is opened or not.
adb shell dumpsys input_method | grep mInputShown
在输出中 mInputShown=true
如果键盘打开,mInputShown=false
如果键盘关闭.JAVA代码:
In output mInputShown=true
if keyboard is open and mInputShown=false
if keyboard is closed.
JAVA code:
String cmd[] = new String[]{"adb", "shell", "dumpsys", "input_method", "|" ,"grep", "mInputShown"};
Process process = Runtime.getRuntime().exec(cmd);
BufferedReader reader = new BufferedReader(new InputStreamReader(
process.getInputStream()));
String output = reader.readLine();
这篇关于如何使用 JAVA 和 ADB 命令在 Appium 中检查键盘是否打开的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
更多推荐
[db:关键词]
发布评论