3

I want to know how to change input method using the command line. Any ideas? Sorry for my english.

I have tried this:

C:\Users\admin>adb shell
shell@android:/ $ ime list -a
ime list -a
com.huawei.inputmethod.hwpal/.PinyinIME:
  mId=com.huawei.inputmethod.hwpal/.PinyinIME mSettingsActivityName=com.huawei.i
nputmethod.hwpal.SettingsActivity
  mIsDefaultResId=0x7f080000
  Service:
    priority=0 preferredOrder=0 match=0x108000 specificIndex=-1 isDefault=false
    ServiceInfo:
      name=com.huawei.inputmethod.hwpal.PinyinIME
      packageName=com.huawei.inputmethod.hwpal
      labelRes=0x7f0c0000 nonLocalizedLabel=null icon=0x0
      enabled=true exported=true processName=com.huawei.inputmethod.hwpal
      permission=android.permission.BIND_INPUT_METHOD
      flags=0x0
org.apelikecoder.bulgariankeyboard/.BulgarianIME:
  mId=org.apelikecoder.bulgariankeyboard/.BulgarianIME mSettingsActivityName=org
.apelikecoder.bulgariankeyboard.BulgarianIMESettings
  mIsDefaultResId=0x0
  Service:
    priority=0 preferredOrder=0 match=0x108000 specificIndex=-1 isDefault=false
    ServiceInfo:
      name=org.apelikecoder.bulgariankeyboard.BulgarianIME
      packageName=org.apelikecoder.bulgariankeyboard
      enabled=true exported=true processName=org.apelikecoder.bulgariankeyboard
      permission=android.permission.BIND_INPUT_METHOD
      flags=0x0
com.thihaayekyaw.frozenkeyboard/com.example.android.softkeyboard.SoftKeyboard:
  mId=com.thihaayekyaw.frozenkeyboard/com.example.android.softkeyboard.SoftKeybo
ard mSettingsActivityName=com.example.android.softkeyboard.FKSettings
  mIsDefaultResId=0x0
  Service:
    priority=0 preferredOrder=0 match=0x108000 specificIndex=-1 isDefault=false
    ServiceInfo:
      name=com.example.android.softkeyboard.SoftKeyboard
      packageName=com.thihaayekyaw.frozenkeyboard
      enabled=true exported=true processName=com.thihaayekyaw.frozenkeyboard
      permission=android.permission.BIND_INPUT_METHOD
      flags=0x0
shell@android:/ $ ime enable com.example.android.softkeyboard.SoftKeyboard
ime enable com.example.android.softkeyboard.SoftKeyboard
Error: Unknown id: null
shell@android:/ $
7

The ID of an IME isn't just the class name. Multiple packages, signed by different developer certificates, might use the same class name. That's especially likely in this case where it's a downloaded example. You need to use both parts of the ID, before and after the /. In this case:

shell@android:/ $ ime enable com.thihaayekyaw.frozenkeyboard/com.example.android.softkeyboard.SoftKeyboard

Note, though, that ime enable doesn't select that input method: it merely allows it to be selected by checking its checkbox in the IME list in SettingsLanguage and input. To select an IME (i.e. to make it the one that will appear when an EditText is focused) you need to use ime set:

shell@android:/ $ ime set com.thihaayekyaw.frozenkeyboard/com.example.android.softkeyboard.SoftKeyboard

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.