adb shell 查看和修改输入法

//查看系统当前的输入法
adb shell settings get secure default_input_method
com.google.android.inputmethod.latin/com.android.inputmethod.latin.LatinIME 
//获取当下系统的所有输入法
adb shell ime list
com.google.android.googlequicksearchbox/com.google.android.voicesearch.ime.VoiceInputMethodService:
  mId=com.google.android.googlequicksearchbox/com.google.android.voicesearch.ime.VoiceInputMethodService mSettingsActivityName=com.google.android.apps.gsa.settingsui.VoiceSearchPreferences mSupportsSwitchingToNextInputMethod=false
  mIsDefaultResId=0x0
  Service:
    priority=0 preferredOrder=0 match=0x108000 specificIndex=-1 isDefault=false
    ServiceInfo:
      name=com.google.android.voicesearch.ime.VoiceInputMethodService
      packageName=com.google.android.googlequicksearchbox
      labelRes=0x7f140a2f nonLocalizedLabel=null icon=0x0 banner=0x0
      processName=com.google.android.googlequicksearchbox:search
      enabled=true exported=true directBootAware=false
      permission=android.permission.BIND_INPUT_METHOD
      flags=0x0
      ApplicationInfo:
        name=com.google.android.apps.gsa.binaries.velvet.app.VelvetApplication
        packageName=com.google.android.googlequicksearchbox
        labelRes=0x7f14015c nonLocalizedLabel=null icon=0x7f03000a banner=0x0
        className=com.google.android.apps.gsa.binaries.velvet.app.VelvetApplication
        processName=com.google.android.googlequicksearchbox
        taskAffinity=com.google.android.googlequicksearchbox
        uid=10042 flags=0xb8dbbe45 privateFlags=0x418 theme=0x7f1504ed
        requiresSmallestWidthDp=0 compatibleWidthLimitDp=0 largestWidthLimitDp=0
        sourceDir=/system/priv-app/Velvet/Velvet.apk
        seinfo=default:privapp:targetSdkVersion=26
        seinfoUser=:complete
        dataDir=/data/user/0/com.google.android.googlequicksearchbox
        deviceProtectedDataDir=/data/user_de/0/com.google.android.googlequicksearchbox
        credentialProtectedDataDir=/data/user/0/com.google.android.googlequicksearchbox
        enabled=true minSdkVersion=21 targetSdkVersion=26 versionCode=300803332 targetSandboxVersion=1
        manageSpaceActivityName=com.google.android.apps.gsa.managespace.VelvetManageSpaceActivity
        supportsRtl=true
        fullBackupContent=true
        networkSecurityConfigRes=0x7f0a0046
com.google.android.inputmethod.latin/com.android.inputmethod.latin.LatinIME:
  mId=com.google.android.inputmethod.latin/com.android.inputmethod.latin.LatinIME mSettingsActivityName=com.google.android.apps.inputmethod.latin.preference.SettingsActivity mSupportsSwitchingToNextInputMethod=true
  mIsDefaultResId=0x7f0c00f6
  Service:
    priority=0 preferredOrder=0 match=0x108000 specificIndex=-1 isDefault=false
    ServiceInfo:
      name=com.android.inputmethod.latin.LatinIME
      packageName=com.google.android.inputmethod.latin
      labelRes=0x7f1302c0 nonLocalizedLabel=null icon=0x0 banner=0x0
      enabled=true exported=true directBootAware=true
      permission=android.permission.BIND_INPUT_METHOD
      flags=0x0
      ApplicationInfo:
        name=com.google.android.apps.inputmethod.latin.LatinApp
        packageName=com.google.android.inputmethod.latin
        labelRes=0x7f1302c0 nonLocalizedLabel=null icon=0x7f030003 banner=0x0
        className=com.google.android.apps.inputmethod.latin.LatinApp
        processName=com.google.android.inputmethod.latin
        taskAffinity=com.google.android.inputmethod.latin
        uid=10078 flags=0x28cabe45 privateFlags=0x1110 theme=0x7f140012
        requiresSmallestWidthDp=0 compatibleWidthLimitDp=0 largestWidthLimitDp=0
        sourceDir=/system/app/LatinImeGoogle/LatinImeGoogle.apk
        seinfo=default:targetSdkVersion=28
        seinfoUser=:complete
        dataDir=/data/user/0/com.google.android.inputmethod.latin
        deviceProtectedDataDir=/data/user_de/0/com.google.android.inputmethod.latin
        credentialProtectedDataDir=/data/user/0/com.google.android.inputmethod.latin
        enabled=true minSdkVersion=21 targetSdkVersion=28 versionCode=26761314 targetSandboxVersion=1
        supportsRtl=true
        fullBackupContent=true


//获取当前的可用输入法
adb shell ime list -s
com.google.android.googlequicksearchbox/com.google.android.voicesearch.ime.VoiceInputMethodService
com.google.android.inputmethod.latin/com.android.inputmethod.latin.LatinIME

//设置当前的输入法
adb shell settings put secure default_input_method com.sohu.inputmethod.sogou/.SogouIME

//获取当前的输入法
adb shell settings get secure default_input_method
com.sohu.inputmethod.sogou/.SogouIME

//设置当前的输入法
adb shell settings put secure default_input_method com.sohu.inputmethod.sogou/.SogouIME

 

你可能感兴趣的:(android基础架构)