使用adb命令在APP中输入中文

搞了好几天的东西,终于搞定了,记录下
text = '微信'
text = text.encode('UTF-7').decode('US-ASCII')
text = text.replace('+', '\&')
os.popen('adb shell "settings put secure default_input_method jp.jun_nama.test.utf7ime/.Utf7ImeService"')
os.popen('adb shell "input text ' + text + '"')
需要安装一个输入法的apk (Utf7Ime.apk)
posted @ 2018-01-15 16:14  wsy11  阅读(594)  评论(0编辑  收藏  举报