ADBKeyBoard 安装 (中文输入)
问题:adb shell input text '你好嗎'
is not going to work.
ADBKeyboard 在这些环境下会有所资助,尤其是在设备自动化和测试中
1. 下载
github网址:https://github.com/senzhk/ADBKeyBoard?tab=readme-ov-file
apk下载:
https://github.com/senzhk/ADBKeyBoard/blob/master/ADBKeyboard.apk
将下载好的apk放置在cmd命令同一个文件夹中,同时手机开启权限,可通过adb安装应用
https://i-blog.csdnimg.cn/direct/2e67dbf9a7124063a5a616b655bc3861.png
https://i-blog.csdnimg.cn/direct/c1cef29f87c141f29d955b9bf67ccf77.png
2. 安装
安装命令:
adb install ADBKeyboard.apk
设置手机输入法
adb shell ime enable com.android.adbkeyboard/.AdbIME
adb shell ime set com.android.adbkeyboard/.AdbIME
3.示例
利用案例
import os
import base64
chars = "你好"
charsb64 = str(base64.b64encode(chars.encode("utf-8")))
os.system("adb shell am broadcast -a ADB_INPUT_B64 --es msg %s" % charsb64)
测试完成,返回原先的输入法:
原先输入法为:com.baidu.input_mi/.ImeService
adb shell ime set com.baidu.input_mi/.ImeService
其他命令
adb shell ime list -a # Check your available virtual keyboards
adb shell ime reset# Reset to default, don't care which keyboard was chosen before switch
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
页:
[1]