Created
August 31, 2024 22:30
-
-
Save astraube/6b13eb9de3723955b074662315a693fe to your computer and use it in GitHub Desktop.
Android ADB Script Tap the Center of the Screen in a Loop
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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