You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
is_a_tty: 0 is a terminal, IGNBRK supported: false
is_a_tty: 1 is a terminal, OPOST supported: false
is_a_tty: 2 is a terminal, OPOST supported: false
Expected behavior is that standard FDs should fail with ENOTTY as is the case with non-interactive adb shell:
~$ adb shell /data/local/tmp/is_a_tty
~$ adb logcat -d -s is_a_tty
is_a_tty: 0 is not a terminal
is_a_tty: 1 is not a terminal
is_a_tty: 2 is not a terminal
It's because adb shell uses shell protocol for communication with adbd. So in our case, running like openStream("shell,v2,raw:/data/local/tmp/is_a_tty") works i.e. standard FDs are no more attached to a PTY. But here comes the next problem: reading and writing to AdbStream no more works because libadb-android does not support shell protocol (version 2) (related feature request).
PS: I've created this issue for future reference. Close it if you want.
The text was updated successfully, but these errors were encountered:
The library still has lots of issues and reflects its predecessors rather than the AOSP (for the sake of familiarity). But some of these has to change, eventually.
With
shell:
service it's not possible to use raw (non-interactive) mode.adbd
still attaches the forked process of the sent command to a pseudo terminal device, but some interactive flags are removed usingcfmakeraw
.So we cannot use
tty
,isatty
etc. reliably. But we can check, sayIGNBRK
for STDIN andOPOST
for STDOUT/STDERR, as these flags have been removed.Native code, compiled and copied to
/data/local/tmp/
:Java code:
When we run it, it says:
Expected behavior is that standard FDs should fail with
ENOTTY
as is the case with non-interactiveadb shell
:It's because
adb shell
uses shell protocol for communication withadbd
. So in our case, running likeopenStream("shell,v2,raw:/data/local/tmp/is_a_tty")
works i.e. standard FDs are no more attached to a PTY. But here comes the next problem: reading and writing to AdbStream no more works becauselibadb-android
does not support shell protocol (version 2) (related feature request).PS: I've created this issue for future reference. Close it if you want.
The text was updated successfully, but these errors were encountered: