Skip to content

Instantly share code, notes, and snippets.

@and2long
Last active July 26, 2020 05:00
Show Gist options
  • Save and2long/2de95a4a247039ca54b278003129c4a2 to your computer and use it in GitHub Desktop.
Save and2long/2de95a4a247039ca54b278003129c4a2 to your computer and use it in GitHub Desktop.
(安卓)自动滑动视频。
findDevices() {
string=$(adb devices | egrep ".*device$")
if [ $? -eq 0 ]; then
devices=(${string//device/})
time=$(date "+%Y-%m-%d %H:%M:%S")
echo "$time 检测到${#devices[*]}台设备"
for d in ${devices[@]}; do
echo "$d : $(adb -s $d shell getprop ro.product.model)"
done
return ${#devices[*]}
else
echo "没有检测到设备。"
return 0
fi
}
findDevices
while [ $? -gt 0 ]; do
echo "发送滑动指令"
for d in ${devices[@]}; do
adb -s $d shell input swipe 500 500 500 400 100
done
sleep 8
findDevices
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment