Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hide Soft Keyboard using adb

I want to hide soft keyboard using adb shell command. Is there any specific command available to do so or in any ways can I get the current focus window object over adb on which I can hide the keyboard if showing?

like image 245
Krishnakant Avatar asked Sep 04 '15 10:09

Krishnakant


3 Answers

you can hide your keyboard with

adb shell input keyevent 111

you can find all keyevents are here: http://developer.android.com/reference/android/view/KeyEvent.html

like image 74
Matthias Miro Avatar answered Sep 21 '22 22:09

Matthias Miro


@Matthias Miro answer is 4.5 years old and it did not work for me with Android 9. Instead I found the following solution in a GitHub issue thread which worked:

  1. Install Null Keyboard
  2. Select it via ADB: adb shell ime set com.wparam.nullkeyboard/.NullKeyboard

to get your original keyboard back:

  1. List all available keyboards: adb shell ime list -s -a
  2. Select the one via: adb shell ime set [keyboard line from previous command]
like image 29
elig Avatar answered Sep 18 '22 22:09

elig


I have found a faster and easier solution through adb, by disabling the keyboard entirely.

you can hide your keyboard permament with

adb shell pm disable-user com.android.inputmethod.latin
like image 43
Glenn Avatar answered Sep 21 '22 22:09

Glenn