我希望使用strace工具收集对android应用程序的系统调用事件,首先我使用午餐模拟器,然后在linux终端中编写下一个命令行:
adb -s emulator-5554 shell在仿真器shell之后,我想编写strace命令,如图所示:

对于我来说,这很好,但是当我编写java代码的时候。
Process p=Runtime.getRuntime().exec("adb -s emulator-5554 shell");
Process p1=Runtime.getRuntime().exec("strace -p 871");它没有工作,谁能帮我在eclipse中编写这个java代码,请注意图片
发布于 2016-12-28 17:36:41
adb shell命令打开一个执行strace的新shell。命令的Java版本在默认shell中执行这两个命令。因此,你必须把它们结合起来:
Process p=Runtime.getRuntime().exec("adb -s emulator-5554 shell strace -p 871");
https://stackoverflow.com/questions/41364155
复制相似问题