How to simulate touch events on Android device?
Asked Answered
V

2

1

Does the Android API expose facilities for generating touch events, for example, repeatedly simulating different gestures on the screen for testing?

Varion answered 10/8, 2015 at 3:8 Comment(0)
B
0

Doesn adb commands will work for u or u need some kind of monkay testing tool commands ???

For adb commands u can use below shell commands...

adb shell input tap x y and also

adb shell sendevent /dev/input/event0 3 0 5 adb shell sendevent /dev/input/event0 3 1 29 adb shell sendevent /dev/input/event0 1 330 1 adb shell sendevent /dev/input/event0 0 0 0 adb shell sendevent /dev/input/event0 1 330 0 adb shell sendevent /dev/input/event0 0 0 0

Brayton answered 10/8, 2015 at 3:17 Comment(1)
Did u find best solution. If u found one please update it here or accept some answer so that others will know answer as well.Brayton
S
0

You can write an Android Instrumention Test to implement UI auto testing in android, see Tesing UI for a Single Activity and Android Testing Support Library.

If you are new to Android Test, I suggest you read Activity Testing first.

Sanatorium answered 10/8, 2015 at 3:27 Comment(1)
Does it work for any application, even outside of the current application? Is there any sample of how to use it?Depressant

© 2022 - 2024 — McMap. All rights reserved.