Skip to content

Commit

Permalink
adb输入中文文本 (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
chaomaer authored Jul 30, 2024
1 parent 736b081 commit 10a082c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1311,6 +1311,16 @@ adb shell input text hello

现在 `hello` 出现在文本框了。

如果输入的是中文的话,需要在手机中安装[ADBKeyboard.apk](https://github.com/senzhk/ADBKeyBoard),详细文档见[这里](https://github.com/senzhk/ADBKeyBoard)

然后执行命令:
```
1. 设置当前输入法为:ADBKeyBoard
adb shell ime set com.android.adbkeyboard/.AdbIME
2. 输入中文
adb shell am broadcast -a ADB_INPUT_TEXT --es msg '你好'
```

## 查看日志

Android 系统的日志分为两部分,底层的 Linux 内核日志输出到 /proc/kmsg,Android 的日志输出到 /dev/log。
Expand Down

0 comments on commit 10a082c

Please sign in to comment.