Skip to content

Instantly share code, notes, and snippets.

@seaders
Created March 5, 2015 17:39
Show Gist options
  • Select an option

  • Save seaders/574084682c5875dda698 to your computer and use it in GitHub Desktop.

Select an option

Save seaders/574084682c5875dda698 to your computer and use it in GitHub Desktop.
#!/usr/local/bin/python
import time, sys, wrapper
target = int(sys.argv[1])
curr = int(sys.argv[2])
adb_loc = '/Developer/sdks/android/platform-tools/adb'
adb = wrapper.CommandWrapper(adb_loc)
def tap(msg, x, y, delay):
time.sleep(delay)
print msg
adb.shell('input', 'tap', x, y)
try:
delay = 0
while curr < target:
tap('tapping top entry', 1485, 295, delay)
tap('pausing', 65, 65, 6)
tap('back to menu', 835, 995, 1)
curr += 1
print '{} times, only {} more to go...'.format(curr, target - curr)
delay = 3
except KeyboardInterrupt:
pass
#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment