Android的使用strace在真实设备 [英] Android strace in Real device

查看:1033
本文介绍了Android的使用strace在真实设备的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下的情况下,我想监视系统调用Android手机等等
我做了一个脚本来做到这一点。随着Android模拟器完美的作品(写入应用程序的痕迹,在我的Ubuntu特定文件)。
问题是,当我附上一个真正的手机来分析它,它说,在结果文件以下内容:

I have the following situation, I want to monitor the system calls on Android phones so I made an script to do that. With Android Emulator works perfectly (writes the traces of the application in a specific file on my Ubuntu). The problem is when I attach a real phone to analyze it, it says the following in the result file:

ptrace attach failed: Operation not permitted

我使用这个code得到它,但我不明白为什么它的工作原理在模拟器上,而不是在真正扎根设备。

I'm using this code to get it, but I don't understand why it works on the emulator and not in the rooted real device.

这是我在perl中使用COMAND:

This is the comand I use in perl:

system("$dirTools/adb -s $Device shell strace -p $PID[1]>$dirRecordDataSet/$Date/$appName &");

任何建议?在此先感谢

Any suggestion? Thanks in advance

推荐答案

马爷是ADB守护有限的权限运行。你可以尝试使用setuid袋鼠安装strace的。下面是关于它的手册页的建议是:

Maye be the adb daemon runs with limited privilege. You can try to install strace with setuid roo. Here is manpage advice about it :

设置uid安装

如果strace是安装setuid为根
  然后调用用户将能够
  重视和追踪所拥有的进程
  的任何用户。此外setuid和
  setgid程序将被执行,
  用正确的有效跟踪
  特权。由于只有用户信赖
  具有完全root权限应该是
  允许做这些事情,它只
  有意义的安装strace的作为
  setuid为根时,用户可谁
  执行它被限制为那些
  谁拥有这种信任的用户。对于
  例如,它是有道理的安装
  strace的特殊版本模式
  rwsr-xr--',root用户和组
  跟踪,跟踪的,会员
  组是用户信赖。如果你使用
  此功能,请记得
  安装strace的一个非setuid的版本
  对于普通LUSERS使用。

If strace is installed setuid to root then the invoking user will be able to attach to and trace processes owned by any user. In addition setuid and setgid programs will be executed and traced with the correct effective privileges. Since only users trusted with full root privileges should be allowed to do these things, it only makes sense to install strace as setuid to root when the users who can execute it are restricted to those users who have this trust. For example, it makes sense to install a special version of strace with mode 'rwsr-xr--', user root and group trace, where members of the trace group are trusted users. If you do use this feature, please remember to install a non-setuid version of strace for ordinary lusers to use.

这篇关于Android的使用strace在真实设备的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆