I have a command that accesses the Input Method Manager and want it to run immediately as my emulator boots. Here's one of those commands:

adb wait-for-device shell ime disable com.android.inputmethod.latin/.LatinIME

I ran my Android 2.3.3 emulator as a process not run from the terminal. Then opened the terminal and ran the command written above. It apparently waited only for the device status to turn to device and returned errors saying that the Input Method Manager could not be accessed! So I would like to know whether there is an option in place of wait-for-device which ensures that the command waits, not only until the status of the device is device but until the home screen shows up? Or is there an entirely different way to ensure that a specific command executes, immediately after the home screen shows up?

I googled, and in particular searched developer.android.com for options, couldn't find one convenient as one that could be fed into an adb command.

UPDATE: I tried

adb wait-for-device sleep 200
adb shell ime disable com.android.inputmethod.latin/.LatinIME

It sleeps 200 seconds after the emulator status turns device. This way there is higher probability the IME command executes error-free.

There are ways to ensure that the even SD card is mounted, but they involve java, and not adb commands. Right now I am not familiar with linking the output of a java program to an adb command.

Any help is greatly appreciated!

有帮助吗?

解决方案

I know this is not a direct answer to your question about waiting for the IME to be up, however I noticed your trying to disable an IME.

If this is actually your goal maybe try the following post, but for latin.

Disabling Japanese IME through ADB shell

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top