Which adb commands?
@pratyakshb1995
Settings app is crashing too if you touch in recent list the app info.
Enabling keyboard using command-line
All the enabled input methods can be listed by this command:
adb shell ime list -s
Example output
com.android.inputmethod.latin/.LatinIME
net.zhdev.ctrlvkeyboard/.CtrlVKeyboard
All the available (enabled or not) IME services can be listed through
adb shell ime list -a
Example output
com.android.inputmethod.latin/.LatinIME:
mId=
com.android.inputmethod.latin/.LatinIME mSettingsActivityName=com.android.inputmethod.latin.settings.SettingsActivity
mIsDefaultResId=0x7f070000
Service:
priority=0 preferredOrder=0 match=0x108000 specificIndex=-1 isDefault=false
ServiceInfo:
name=com.android.inputmethod.latin.LatinIME
packageName=com.android.inputmethod.latin
labelRes=0x7f08003a nonLocalizedLabel=null icon=0x0 banner=0x0
enabled=true exported=true processName=com.android.inputmethod.latin
permission=android.permission.BIND_INPUT_METHOD
flags=0x0
net.zhdev.ctrlvkeyboard/.CtrlVKeyboard:
mId=
net.zhdev.ctrlvkeyboard/.CtrlVKeyboard mSettingsActivityName=null
mIsDefaultResId=0x0
Service:
priority=0 preferredOrder=0 match=0x108000 specificIndex=-1 isDefault=false
ServiceInfo:
name=net.zhdev.ctrlvkeyboard.CtrlVKeyboard
packageName=net.zhdev.ctrlvkeyboard
labelRes=0x7f0b0015 nonLocalizedLabel=null icon=0x0 banner=0x0
enabled=true exported=true processName=net.zhdev.ctrlvkeyboard
permission=android.permission.BIND_INPUT_METHOD
flags=0x0
com.touchtype.swiftkey/com.touchtype.KeyboardService:
mId=
com.touchtype.swiftkey/com.touchtype.KeyboardService mSettingsActivityName=com.touchtype.settings.TouchTypeKeyboardSettings
mIsDefaultResId=0x0
Service:
priority=0 preferredOrder=0 match=0x108000 specificIndex=-1 isDefault=false
ServiceInfo:
name=com.touchtype.KeyboardService
packageName=com.touchtype.swiftkey
enabled=true exported=true processName=com.touchtype.swiftkey
permission=android.permission.BIND_INPUT_METHOD
flags=0x0
The highlighted strings next to mId= are the IDs of the keyboard apps available in my system.
In any ID, the string before / is the package name of the keyboard app. Example: for Swiftkey keyboard, the mId is:
com.touchtype.swiftkey/com.touchtype.KeyboardService
The string com.touchtype.swiftkey is the package name of Swiftkey app. Package name is what will help you to find the appropriate mID that you should use to enable a particular keyboard app.
In order to add or remove an IME into enabled input methods, do
# replace ID with mId of the keyboard app which you want to add or remove
adb shell ime enable ID
adb shell ime disable ID
To make an IME the default IME of the system, do
# Note that it doesn't matter whether the IME is added into enabled input methods or not. Consider this a direct override.
adb shell settings put secure default_input_method "ID"
adb shell content update --uri content://settings/secure --bind value:s:"ID" --where "name='default_input_method'" # alternative to above command
Source Link