Skip to content

Instantly share code, notes, and snippets.

@Kagee
Last active September 13, 2015 20:31
Show Gist options
  • Save Kagee/b99738b072ae5dcccc6c to your computer and use it in GitHub Desktop.
Save Kagee/b99738b072ae5dcccc6c to your computer and use it in GitHub Desktop.
#! /usr/bin/env bash
./adb -d shell input tap 680 270
./adb -d shell input tap 362 1086
sleep 5
AWT_VIDEO=$(./adb -d shell dumpsys window windows | grep -o -P 'mFocusedApp=AppWindowToken{[^ ]*')
AWT_POST="$AWT_VIDEO"
echo "shoul be equal: x${AWT_POST} = x${AWT_VIDEO}";
while [ "${AWT_POST}x" = "${AWT_VIDEO}x" ] ; do
sleep 5;
./adb -d shell input keyevent 4
echo "should be equal 2: x${AWT_POST} = x${AWT_VIDEO}";
AWT_POST=$(./adb -d shell dumpsys window windows | grep -o -P 'mFocusedApp=AppWindowToken{[^ ]*');
done
echo "not equal, pressing back x${AWT_POST} = x${AWT_VIDEO}";
sleep 2
./adb -d shell input tap 536 1114
sleep 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment