0
有什麼方法可以啓動命令'arp'。Android Runtime.exec(「arp」)不起作用
我嘗試:
Runtime rt = Runtime.getRuntime();
proc = rt
.exec("arp")
- >有一個IOException
.exec("/proc/net/arp")
- >有一個IOException
以及(找到了在亞行外殼,一個/proc/net/arp
存在)
還嘗試了一個外殼解決方案:
String sPrefix="/system/bin/sh -c 'proc/net/arp;";
String sPostfix="'";
Runtime rt = Runtime.getRuntime();
proc = rt.exec(sPrefix+sPostfix); // sh -c 'cd someplace; echo do something'
InputStreamReader reader = new InputStreamReader(proc.getInputStream());
BufferedReader buffer = new BufferedReader(reader);
String line = "";
while ((line = buffer.readLine()) != null) {
echo.append(line + "\n");
}
但沒有得到任何回報。
有沒有人有一個想法: - /?
遺憾的是,似乎安卓(我認爲4.0+)的新版本不保留這些信息了。表格是空白的。 –