Monday, August 15, 2011


One of those acquisition to remember

Wednesday, August 03, 2011

Android Monkey Script DispatchPress Bug

When using Monkey Script I noticed that DispatchPress(KEYCODE_BACK)
is doing nothing which really suck. In many cases this is due to the fact that the Activity doesn't consume the Key event.
The solution to this problem is to use a mix of monkey script and
adb shell input command in a sequence.

1 Using monkey script gave some great timing
control. Wait a certain amount of second for the activity and is a
blocking adb call.
2 Finally sending adb shell input keyevent 4 will end the running APK.


adb shell monkey -p -v -v -v -f /sdcard/monkey_script.txt 1
adb shell input keyevent 4