Skip to content

Instantly share code, notes, and snippets.

@astraube
Created August 31, 2024 22:30
Show Gist options
  • Save astraube/6b13eb9de3723955b074662315a693fe to your computer and use it in GitHub Desktop.
Save astraube/6b13eb9de3723955b074662315a693fe to your computer and use it in GitHub Desktop.
Android ADB Script Tap the Center of the Screen in a Loop
#!/bin/bash
# Number of iterations
count=10
# Screen dimensions (example: 1080x1920)
width=1080
height=1920
# Calculate center
center_x=$((width / 2))
center_y=$((height / 2))
# Loop to execute the command
for i in $(seq 1 $count)
do
# Simulate the tap at the center of the screen
adb shell input tap $center_x $center_y
# Wait for 1 second before the next iteration
sleep 1
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment