Skip to content

Instantly share code, notes, and snippets.

@maluta
Created August 29, 2014 15:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maluta/b253f3d7e7d08325c25b to your computer and use it in GitHub Desktop.
Save maluta/b253f3d7e7d08325c25b to your computer and use it in GitHub Desktop.
#/usr/bin/python
'''
My best score in 'Swing Copters' was using this code... :/
https://play.google.com/store/apps/details?id=com.dotgears.swing&hl=en
** Tested only on LG Nexus 4 **
To run just copy this file and run on terminal
# monkeyrunner swing_copters.py
Follow me @maluta
'''
from com.android.monkeyrunner import MonkeyRunner
from com.android.monkeyrunner import MonkeyDevice
import time # sleep
try:
device = MonkeyRunner.waitForConnection()
except:
print("Verify your USB cable and check if ADB is working correctly")
exit()
t = 0.45 # I've tested with '0.3', '0.5' and '0' without good results
while True:
try:
device.touch( 240, 875, MonkeyDevice.DOWN)
device.touch( 240, 875, MonkeyDevice.UP)
except:
print("touch error")
exit()
time.sleep(t)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment