Open main menu

DAVE Developer's Wiki β

Changes

Button Pressing Emulation On Android

No change in size, 08:04, 1 October 2012
no edit summary
== Introduction ==
Sometimes, during the development phases, real hardware buttons are not available, causing bad interaction with the Android interface. It would help to have an emulator to send events as button pressing to the Android system, and it's here that the [http://developer.android.com/tools/help/monkeyrunner_concepts.html MonkeyRunnermonkeyrunner] tool shows its usefulness.
== Setting up MonkeyRunner monkeyrunner ==
You can run MonkeyRunner monkeyrunner from your host machine when the ADB connection with the device is established. The monkeyrunner command is found in the tools/ subdirectory of your SDK directory. Launching monkeyrunner, you can both activate a script or the interactive shell. For more information, please refer to [http://developer.android.com/tools/help/monkeyrunner_concepts.html#RunningMonkeyRunner Running MonkeyRunnermonkeyrunner].
== Emulating key pressing ==
Once the connection is established, you can run MonkeyRunner monkeyrunner from your PC and enter the commands from the interactive shell. As an example, the following sequence emulates the "HOME" button pressing down:
<pre>