-
Notifications
You must be signed in to change notification settings - Fork 80
Android tagets: Piped su call vs --command option #386
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This is interesting behaviour which I see with my device (nexus 5) as well.
I'm not really sure what would be causing this, the only difference I've managed to find between the environments (printing using I think the reason we were using the piping method was that it used to be more reliable for older versions of su however I'm not sure if that is still the case. @setrofim do you know any more information on this? As a side note if you you are trying to use perf report in this way, (for my environment at least) supplying the |
IIRC (and it has been a while), the reason we pipe into I can't think of a reason other than that for the pipe, and would be happy to make the switching to using '-c' . Though it would be have to be thoroughly tested with WA/LISA before merging. Worst case, we can make this a configurable option on target creation. |
The
devlib 1.1.1 works fine in this setup so I have reverted to it. I guess we will need it to be have configurable option. Another option is to test whether you can connect as root from the start. In aosp builds, |
Regarding using As for running adbd as root, if necessary we can add in a check to see if we are |
You are right 37eef46 fixes it. I had only tried released versions of devlib and I missed it. Sorry for the noise. |
This is with (Google Pixel 2):
and (host):
The way
devlib.AndroidTarget.execute
works relies onsu
and there seems to be a difference in behaviour between a call to that method and actually running a command inside ofsu
inside of anadb shell
.I am unsure about the reason but, as an example (the device is connected through
adb
and there exists a/sdcard/devlib-target/perf.data
file on the device):while
gives the expected result.
In fact, going through
adb shell
with oneliners:while the following works:
I am puzzled by this and believe that it is partially due to how
perf
is doing something (notice that it's supposed to read$(pwd)/perf.data
by default, but the error message refers to "the-
file"). However, the fact that the behaviour ofperf
depends on howsu
is called implies thatsu
itself behaves differently.Now, the solution might be to use
-c
(which seems to be somewhat standard) but I have no idea of the consequences this might have; in particular, when using other distributions ofsu
. Was there a reason for usingecho CMD | su
?The text was updated successfully, but these errors were encountered: