Why can I not pipe into adb shell
?
[klm@kth ~]$ echo foo | adb shell cat
^C
The above command hangs on my 4.0.1 emulator, and I\'m
Here's my solution. Put the following into the adb_shell.sh
file and use it instead of adb shell
:
#!/bin/bash
adb forward tcp:12345 tcp:12345
adb shell busybox nc -lp 12345 -e "$@" &
sleep 1s
exec nc -q 1 localhost 12345
This creates an nc
listener which runs the specified command upon the connection, and then connects to it.