Open manoflinux opened 4 years ago
You could use the env variable ADB_SERVER_SOCKET
, which should have the same effect as -L
.
https://github.com/Genymobile/scrcpy/issues/144#issue-321600201
nice! thanks. I will try that when I get a chance. If that will change the behavior of gnirehtet as well then that is probably the solution.
that does eliminate the need for the wrapper, thanks!
But it seems to do the same.
run does the same, and running adb devices while its running takes forever.
./gnirehtet run
2020-06-02 13:53:22.472 INFO Main: Starting relay server on port 31416...
2020-06-02 13:53:22.472 INFO Relay: Relay server started
2020-06-02 13:53:22.473 INFO Main: Checking gnirehtet client...
2020-06-02 13:53:22.603 INFO Main: Starting client...
Starting: Intent { act=com.genymobile.gnirehtet.START cmp=com.genymobile.gnirehtet/.GnirehtetActivity }
and no internet on the device till I reboot it.
doesn't work on linux using adb -L localfilesystem:/tmp/sockfile I know alot of people probably don't know about the -L option as it seems to be only added with newer versions of adb, but it allows you to specify the server by using a sock specification, which is by default tcp:ip:port, but by looking at the code I was able to find out the format localfilesystem:/pathto/sockfile worked as well. My problem is I am using adb on a machine with two active ethernet connections under linux and adb doesn't work at all as far as I can tell in that situation(it runs but nothing is able to contact it which causes adb to spawn another which fails because the first one still has the socket, if someone has some advice please tell me) except with a sock file. If I use -a it tries to listen on only localhost and not all interfaces, which has the same problem. but with a sockfile it works fine, I am able to run a shell, list devices, do all the commands you list in the manual section with no errors, but gnirehtet still doesn't work. I have reinstalled the apk using adb and gnirehtet same effect. I have tried using it on both a windows and linux box with only one active network connection and it works fine, both adp on an ip and gnirehtet.
So to stop gnirehtet from trying to spawn adp instances not using a sockfile I wrote a wrapper which appends the socket command to the beginning of every command line. That got gnirehtet running, but it still doesn't seem to work. When I run it with autorun I get
over and over again. I have tried run as well and it doesn't work, if you need more info I can provide that.
This makes me think that gnirehtet or some library it uses is trying to connect via tcp without trying the sockfile. Am I right? It would be nice to pass the -L socket to gnirehtet through a command line option as well.
Here is the wrapper I wrote, I renamed the original adb to adb.orig and put this shell script in its place, just vi adb and cut and paste this in it to get farther.
!/bin/bash
./adb.orig -L localfilesystem:/tmp/sockfile "$@"