From d686f202b7287c1dff01e62fce688ded14382efb Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Wed, 7 Oct 2020 16:35:47 +0200 Subject: [PATCH] add android_serial so that only uiComparison emulator is used for screenshot comparison Signed-off-by: tobiasKaminsky --- scripts/androidScreenshotTest | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/scripts/androidScreenshotTest b/scripts/androidScreenshotTest index 87733cfed9..8cc6a28b93 100755 --- a/scripts/androidScreenshotTest +++ b/scripts/androidScreenshotTest @@ -47,7 +47,19 @@ fi sed -i s'#false#true#'g src/main/res/values/setup.xml -emulator -writable-system -avd uiComparison -no-snapshot -gpu swiftshader_indirect -no-audio -skin 500x833 & +# check if emulator is running +emulatorIsRunning=false +while read line ; do + if [[ $(adb -s $line emu avd name 2>/dev/null | head -n1) =~ uiComparison.* ]]; then + emulatorIsRunning=true + export ANDROID_SERIAL=$line + break + fi +done < <(adb devices | cut -f1) + +if [ ! $emulatorIsRunning ] ; then + emulator -writable-system -avd uiComparison -no-snapshot -gpu swiftshader_indirect -no-audio -skin 500x833 & +fi if [ -e $5 ] ; then color="" @@ -67,3 +79,4 @@ fi sed -i s'#true#false#'g src/main/res/values/setup.xml +unset ANDROID_SERIAL