I am trying to execute traceroute
command following way:
Runtime r = Runtime.getRuntime();
Process p = r.exec("traceroute google.com");
BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream()));
while ((inputLine = in.readLine()) !=开发者_Python百科 null) {
Log.d(tag,inputLine);
}
But it is giving me the following error:
java.io.IOException: Error running exec().
Commands: [traceroute, 202.164.36.66] Working Directory: null Environment: null
It works fine for ping
or any other command of linux, please help.
There is no Traceroute installed on the device, so this will not work.
精彩评论