Skip to content

Instantly share code, notes, and snippets.

@astraube
Created August 31, 2024 22:29
Show Gist options
  • Save astraube/59ae658a1004a5faf4281061e4d6fef1 to your computer and use it in GitHub Desktop.
Save astraube/59ae658a1004a5faf4281061e4d6fef1 to your computer and use it in GitHub Desktop.
Andrid ADB Script to Loop for Continuous Bottom-Up Movement
#!/bin/bash
# Number of iterations
count=10
# Screen dimensions (example: 1080x1920)
width=1080
height=1920
# Start and end coordinates for swipe
start_x=$((width / 2))
start_y=$((height - 120)) # slightly above the bottom edge
end_x=$start_x
end_y=$((height / 6)) # move to the top one-sixth of the screen
# Loop to execute the swipe command
for i in $(seq 1 $count)
do
# Simulate the swipe from bottom to top
adb shell input swipe $start_x $start_y $end_x $end_y 1000
# Wait for 1 second before the next swipe
sleep 1
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment