我无法从我的java应用程序运行strace命令。
我尝试了上面的代码
try {
// Executes the command.
java.lang.Process process = Runtime.getRuntime().exec("strace -p 2545 -o /mnt/sdcard/Result.txt");
BufferedReader reader = new BufferedReader(
new InputStreamReader(process.getInputStream()));
int read;
char[] buffer = new char[4096];
StringBuffer output = new StringBuffer();
while ((read = reader.read(buffer)) > 0) {
output.append(buffer, 0, read);
}
reader.close();
// Waits for the command to finish.
process.waitFor();
output.toString() ;
} catch (IOException e) {
throw new RuntimeException(e);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
我可以帮忙吗?我的Android版本是2.2,我的内核版本是2.6.32.9