제가 adb shell monkey 를 이용해 앱에대한 Random클릭 사건을 해보려고 하는데..
저의 코드는 아래와 같습니다.
String rs = Executer("monkey -f /sdcard/a.txt 5");
public String Executer(String command) {
StringBuffer output = new StringBuffer();
Process p;
try {
p = Runtime.getRuntime().exec(command);
p.waitFor();
BufferedReader reader = new BufferedReader(new InputStreamReader(p.getInputStream()));
String line = "";
while ((line = reader.readLine())!= null) {
output.append(line + "n");
}
} catch (Exception e) {
e.printStackTrace();
}
String response = output.toString();
return response;
}
그리고 a.txt 에는 아래와 같이 있음.
type= user
speed= 1000
start data >>
LaunchActivity(com.hi.appmanager,com.hi.appmanager.MainActivity)
DispatchPointer(0, 0, 0, 300, 300, 0,0,0,0,0,0,0)
UserWait(1000)
DispatchPointer(0, 0, 0, 400, 400, 0,0,0,0,0,0,0)
UserWait(1000)
그런데 아무런 응답도 없네요... 방법 좀알려주세요.