2015-05-29 85 views
1

上模擬快速掃在我的應用我使用su命令在我的應用程序來模擬刷卡:植根設備

Process p = Runtime.getRuntime().exec(new String[]{"su", "-c", "adb 
      shell input touchscreen swipe" + " " + oldCoordinates[i] + 
      " " + oldCoordinates[i+1] + " " + newCoordinates[j] + " " 
      + newCoordinates[j+1]}); 

p.waitFor(); 

但它正在採取1秒左右才能執行此命令... 我怎樣才能提高速度還是有任何其他的我可以模擬快速刷卡?

回答

0

模擬刷卡的最好方法是使用亞行的shell命令「的SendEvent」。您可以通過圖書館運行這些命令「EventInjector」通過Rado.Though做在他的書房中使用可能是您的設備不同(例如命令:的SendEvent 2 0 2323)... 您可以從命令:: adb shell getevent獲得所需的命令..... ::

相關問題