Skip to content
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

Option to ignore TCPIP ADB connections #27

Open
parkerlreed opened this issue Nov 27, 2024 · 0 comments
Open

Option to ignore TCPIP ADB connections #27

parkerlreed opened this issue Nov 27, 2024 · 0 comments

Comments

@parkerlreed
Copy link

I wrote up a quick script to grab the IP from the device and automatically put it into TCPIP mode and connect.

This works fine but autoadb then gets into an infinite loop when it sees the "new" device on TCPIP.

Would be great to have an option to only listen for new USB devices (I can ignore the TCPIP serial manually in my bash script but autoadb would still be continually running the script)

#!/usr/bin/env bash
ip_address=$(adb -s $1 shell ip a | awk '/^[0-9]+: wlan0:/ {found=1} found && /inet / && !/inet6/ {sub(/\/.*/, "", $2); print $2; exit}')
adb -s $1 tcpip 5555
adb connect $ip_address:5555
[parker@parker-framework ~]$ autoadb adb-tcpip-switcharoo '{}'
Detected device R3CR700V30T
restarting in TCP mode port: 5555
Detected device 192.168.1.229:5555
connected to 192.168.1.229:5555
restarting in TCP mode port: 5555
already connected to 192.168.1.229:5555
Detected device 192.168.1.229:5555
error: closed
failed to connect to '192.168.1.229:5555': Connection refused
Detected device 192.168.1.229:5555
restarting in TCP mode port: 5555
already connected to 192.168.1.229:5555
Detected device 192.168.1.229:5555
restarting in TCP mode port: 5555
already connected to 192.168.1.229:5555
Detected device 192.168.1.229:5555
restarting in TCP mode port: 5555
failed to connect to '192.168.1.229:5555': Connection refused
^C
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant