I have just made an android application as System app to start monkey command for Calculator package. My app has a button and it will start monkey once clicked.
public void onClick(View v) {
try {
Runtime.getRuntime().exec("monkey -p com.google.android.calculator --throttle 200 -v 10000");
} catch (IOException e) {
// to do something
}
}
==> it worked fine with touches = 1000 but if I increase to 10000, monkey runs for about 1 minutes then freeze screen and I can not do anythings.
==> I trying use Adb shell same monkey command and even though increase touches to 50000, it still work fine.
I don't know why my device freeze screen, and what is difference between adb shell monkey
and using runtime.exec.
Someone can help me? Thanks in advance^