2

Im working on an app, which would contain arrays which will have their intervals and I want to run the array so every interval, the app would run in the background and simulate a tap on the screen

Basically, the question is, if I can simulate the tap, and if yes, how

IDNK
  • 21
  • 4
  • 3
    Does this answer your question? [How can I reliably simulate touch events on Android without root (like Automate and Tasker)?](https://stackoverflow.com/questions/50775698/how-can-i-reliably-simulate-touch-events-on-android-without-root-like-automate) – AmirSina Mashayekh Jun 12 '20 at 15:06

1 Answers1

1

If you are running this as part of an instrumented test, that is very simple: (need to add UiAutomator for this)

val device = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation())
device.click(X,Y)

If you want to click on the screen during a normal app run: check This SO question

Lena Bru
  • 13,521
  • 11
  • 61
  • 126