adb shell에 있는 getevent와 sendevent 명령어를 어플에서 실행시켜서 터치값을 Log로 확인하고

 

강제로 touch를 넣고 싶은데요....방법이 없을까요??

 

인터넷에 있는 Runtime 과 Process를 이용하여 명령어를 입력하는 소스는 getevent후에  에러가 뜨더라구요.

 

 

 

 Runtime runtime = Runtime.getRuntime();
        Process process;
        String res = "-0-";
        try {
                String cmd = "getevent";
                process = runtime.exec(cmd);
                BufferedReader br = new BufferedReader(new InputStreamReader(process.getInputStream()));
                String line ;
                while ((line = br.readLine()) != null) {
                 Log.i("test",line);
                }
        } catch (Exception e) {
                e.fillInStackTrace();
                Log.e("Process Manager", "Unable to execute top command");
        }

 

이런식으로 하니깐 이벤트를 못받더라구요...다른 명령어는 먹히는거 같은데....;;;

 

고수님들 도움 부탁 드립니다(--)(__)