我想使用 strace 工具收集 Android 应用程序的系统调用事件 首先我在模拟器上吃午饭,然后在 Linux 的终端中编写下一个命令行:
adb -s emulator-5554 shell
在模拟器 shell 之后我想编写 strace 命令,如图所示:
来自 trminal 它对我来说工作得很好,但是当我编写 java 代码时
Process p=Runtime.getRuntime().exec("adb -s emulator-5554 shell");
Process p1=Runtime.getRuntime().exec("strace -p 871");
没有用,谁能帮我在 Eclipse 中编写这段 Java 代码吗? 请注 Intent 片
最佳答案
adb shell
命令打开一个新的 shell,在其中执行 strace
。命令的 Java 版本在默认 shell 中执行这两个命令。因此你必须将它们结合起来:
进程 p=Runtime.getRuntime().exec("adb -s emulator-5554 shell strace -p 871");
关于java - 如何从java代码打开模拟器shell来确定系统调用事件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41364155/