views:

244

answers:

1

I'd like to be able to access the emulator's ui buttons from the commandline or from a test script (e.g. the Back, Menu, or Home buttons.) Can this be done through the adb shell? Or does anyone know of a way to do this directly with OS X?

+1  A: 

You can use the Emulator Console to do this.

Ichorus
It turned out to be easier to work with the emulator's buttons through the adb shell input keyevent commands. The telnet event send was more power than I needed. I was able to automate our app updater with simple "adb -s emulator-$emulatorPort shell input keyevent 22" commands where I programmatically pick up the $emulatorPort when starting a new emulator instance for the test. For text entry and button pushes, check out the android.view.KeyEvent class.
Derrick