Skip to content

Option to ignore TCPIP ADB connections #27

@parkerlreed

Description

@parkerlreed

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions