Skip to content

Instantly share code, notes, and snippets.

@henryhuypham
Last active August 29, 2015 13:56
Show Gist options
  • Save henryhuypham/8929044 to your computer and use it in GitHub Desktop.
Save henryhuypham/8929044 to your computer and use it in GitHub Desktop.
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