diff --git a/android.sh b/android.sh index 5331752..75928f3 100755 --- a/android.sh +++ b/android.sh @@ -8,8 +8,7 @@ FFMPEG_LOGLEVEL="repeat+level+info" mkdir -p ./rec/ -cleanup() -{ +cleanup() { adb_pid=$(ps aux | grep 'adb' | grep ${android} | awk '{print $2}'); echo "] Killing adb services with pid=${adb_pid}" kill -9 ${adb_pid} @@ -28,7 +27,7 @@ else exit 1 fi -is_correct_port () { +is_correct_port() { # check if port 5555 is open PORT=$(nmap -sT -P0 ${android} -p 5555 | awk -F/ '/tcp open/{print $1}') if [[ $PORT == 5555 ]]; then @@ -70,6 +69,7 @@ scrcpy -n \ while : do + sleep 5 CURRENTDATE=`date +"%Y_%m_%d_%T"` echo "] ffmpeg start at ${CURRENTDATE}" @@ -91,6 +91,5 @@ do #CURRENTDATE=`date +"%Y_%m_%d_%T"` echo "] ffmpeg end at ${CURRENTDATE}" - sleep 5 done