Skip to content

Instantly share code, notes, and snippets.

@codlab
Created February 14, 2016 22:17
Show Gist options
  • Select an option

  • Save codlab/5d3b4625f6b0e57c1b85 to your computer and use it in GitHub Desktop.

Select an option

Save codlab/5d3b4625f6b0e57c1b85 to your computer and use it in GitHub Desktop.

Revisions

  1. codlab created this gist Feb 14, 2016.
    26 changes: 26 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,26 @@
    ADB="adb $@ shell"

    let x1=200
    let y1=200
    let x2=220
    let y2=220

    package="com.lucasarts.starts_goo"

    while [ 1 -ne 2 ]
    do
    package=`$ADB dumpsys window windows | grep mCurrentFocus | cut -d'/' -f1 | rev | cut -d' ' -f1 | rev`

    if [ "$package" == "com.lucasarts.starts_goo" ]
    then
    echo -ne "swipe 1\r"
    $ADB input touchscreen swipe $x1 $y1 $x2 $y2 100
    sleep 120
    echo -ne "swipe 2\r"
    $ADB input touchscreen swipe $x1 $y1 $x2 $y2 100
    sleep 120
    else
    echo -e "waiting for star wars ... retrying in few seconds\r"
    sleep 20
    fi
    done