admin管理员组

文章数量:1632445

查看当前手机的输入法

连接手机,终端输入

adb shell ime list -s

可以看到类似下面的结果,

C:\Users\happy>adb shell ime list -s
com.android.inputmethod.latin/.LatinIME
com.nuance.swype.emui/com.nuance.swype.input.HuaweiIME
io.appium.android.ime/.UnicodeIME
com.baidu.input_huawei/.ImeService

C:\Users\happy>

在需要搜索的时候执行下面的代码,切换的输入法用自己查看列表的输入法内容,我这里是搜狗输入法

         //使用adb shell 切换输入法-更改为搜狗拼音,这个看你本来用的什么输入法
        excuteAdbShell("adb shell ime set com.sohu.inputmethod.sogou.xiaomi/.SogouIME");
        //再次点击输入框,调取键盘,软键盘被成功调出
        clickView(page.getSearch());
        //点击右下角的搜索,即ENTER键
        pressKeyCode(AndroidKeyCode.ENTER);
        //再次切回 输入法键盘为Appium unicodeKeyboard
        excuteAdbShell("adb shell ime set io.appium.android.ime/.UnicodeIME");


 

本文标签: 输入法ADB