Reputation: 856
I'm trying to test Strace tool in Android Real device but I can't get any information from it. I was trying the following command but the device still tell me "permission denied".
'$' adb shell su strace -p <PID_number>
I tried to split the commands and make it in two times in this way and it works
'$' adb shell su
'#' strace -p <PID_number>
I tried to put the previous code in this way, to make it secuentially but still is not working:
'$' adb shell su && strace -p <PID_number>
What I'm doing wrong? Thanks in advance
Upvotes: 1
Views: 5334
Reputation: 856
Hey guys finally I found the answer and I want to share it with you :)
As you can see in the previous picture I was using shell:shell
in strace instead of root:shell
so I changed using the following command:
'#' chown root strace
After that I give permission to execute with this one:
'#' chmod 4777 strace
So now, I have strace in this way and I don't see anymore ""ptrace attach failed: Operation not permitted" message
-rwsrwxrwx root shell 134508 2011-03-1 16:41 strace
Thank you to everybody helping me finding the solution ;)
Upvotes: 1
Reputation: 69358
Use:
$ adb shell su -c strace -p <PID>
or set the SETUID bit on strace.
Upvotes: 0
Reputation: 591
Non-rooted phones won't let you run the su
command. Besides, strace
is not a default binary in android. In order for this command to work you will need a rooted device and an ARM binary of strace
.
Upvotes: 1