#coding=utf-8
import os
command0 ='adb shell ime list -s'
command1 ='adb shell settings get secure default_input_method'
command2 ='adb shell ime set com.android.inputmethod.latin/.LatinIME'
command3 ='adb shell ime set io.appium.android.ime/.UnicodeIME'
#列出系统现在所安装的所有输入法
#os.system(command0)
#打印系统当前默认的输入法
#os.system(command1)
#切换latin输入法为当前输入法
#os.system(command2)
#切换appium输入法为当前输入法
#os.system(command3)
class InputMethod:
#切换latin输入法为当前输入法
def enableLatinIME(self):
os.system(command2)
#切换appium输入法为当前输入法
def enableAppiumUnicodeIME(self):
os.system(command3)
import keyCode
# 切换huawei输入法为当前输入法:
keyCode.InputMethod().enableLatinIME()
# 点击键盘搜索按钮
driver.press_keycode('66')
# 切换appium输入法为当前输入法:
keyCode.InputMethod().enableAppiumUnicodeIME()
本文介绍如何使用ADB命令在Android设备上切换不同的输入法,包括LatinIME和AppiumUnicodeIME。通过Python类封装切换逻辑,实现自动化输入法管理。
2723

被折叠的 条评论
为什么被折叠?



