Android touchDown touchUp随处可见

时间:2016-04-18 02:21:56

标签: java android

我目前使用此代码在我的root设备上创建点击

Process process = Runtime.getRuntime().exec("su");
DataOutputStream os = new DataOutputStream(process.getOutputStream());
String cmd = "/system/bin/input tap 100 80\n";
os.writeBytes(cmd);
os.writeBytes("exit\n");
os.flush();
os.close();
process.waitFor();

效果很好,能够点按我想要的任何地方,但是我需要指定点击持续时间(例如,触摸并等待5秒才能触摸)但是此代码使用系统的前缀输入点击来固定点按和时间

0 个答案:

没有答案
相关问题