Last active
August 29, 2015 13:56
-
-
Save henryhuypham/8929044 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Monk { | |
public static void main(String[] args) { | |
Monk monk = new Monk(); | |
monk.demo(); | |
} | |
public void demo() { | |
AdbBackend ab = new AdbBackend(); | |
IChimpDevice device = ab.waitForConnection(); | |
// Print Device Name | |
System.out.println(device.getProperty("build.model")); | |
for (String prop : device.getPropertyList()) { | |
System.out.println(prop + ": " + device.getProperty(prop)); | |
} | |
device.touch(200, 400, TouchPressType.DOWN_AND_UP); | |
device.drag(0, 0, 0, 1200, 100, 500); | |
touch(); | |
device.dispose(); | |
} | |
private void touch() { | |
try { | |
Runtime.getRuntime().exec("input touchscreen tap 100 300" + "\n"); | |
} | |
catch (IOException e) { | |
e.printStackTrace(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment