Skip to content

Commit 8465be6

Browse files
committed
增加adb切换输入法
1 parent 8f3d21b commit 8465be6

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

demo/samples.md

+17
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434

3535
### 输入命令
3636

37+
详细快捷输入命令事例可以参考:[https://github.com/bihe0832/Settings-Tools/blob/master/config/mac/.zshrc](https://github.com/bihe0832/Settings-Tools/blob/master/config/mac/.zshrc)
38+
3739
- 简单文本输入:主要用于简单的中文输入,一次即可完成输入
3840

3941
`adb shell am broadcast -a ZIXIE_ADB_INPUT_TEXT --es msg DATA`
@@ -50,6 +52,21 @@
5052

5153
`adb shell input keyevent 66`
5254

55+
- shell 切换到当前输入法
56+
57+
```
58+
fun zixieadbinputchangetozixieinput(){
59+
# 获取当前输入法包名
60+
current_ime=$(adb shell settings get secure default_input_method | tr -d '\r')
61+
echo "$current_ime"
62+
63+
# 判断输入法是否为指定的包名
64+
if [[ "$current_ime" != "com.bihe0832.adb.input/com.bihe0832.android.base.adb.input.ZixieIME" ]]; then
65+
echo "$current_ime"
66+
adb shell ime set com.bihe0832.adb.input/com.bihe0832.android.base.adb.input.ZixieIME && sleep 2
67+
fi
68+
}
69+
```
5370
## 拼图游戏
5471
5572
### 应用简介

0 commit comments

Comments
 (0)