解決adb shell input text 中文輸入方法
2019.04.13 11:53:37字數 114閱讀 2,280
背景:使用uiautomator2做自動化測試,需要在文本框輸入數字或者中文,默認使用的搜狗輸入法無法使用adb shell input text "XXX"實現。
解決方法:
1.https://github.com/senzhk/ADBKeyBoard,下載並安裝apk。

2.設置
模擬器的settings-----language&input-----勾選上ADB keyboard如下圖,默認輸入法也選擇ADB keyboard

3.命令
adb shell am broadcast -a ADB_INPUT_TEXT --es msg '中文輸入'