Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

"The way of the world is to praise dead saints and prosecute live ones." -- Nathaniel Howe


devel / alt.msdos.batch / Re: How do we find the random Android wireless LAN debugging port from a Windows PC?

SubjectAuthor
o Re: How do we find the random Android wireless LAN debugging port from a Windowscris

1
Re: How do we find the random Android wireless LAN debugging port from a Windows PC?

<tch31e$35g72$1@news.mixmin.net>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=228&group=alt.msdos.batch#228

  copy link   Newsgroups: alt.comp.os.windows-10 alt.internet.wireless comp.mobile.android alt.msdos.batch
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.mixmin.net!.POSTED!not-for-mail
From: cri...@removespam.me.com (cris)
Newsgroups: alt.comp.os.windows-10,alt.internet.wireless,comp.mobile.android,alt.msdos.batch
Subject: Re: How do we find the random Android wireless LAN debugging port from a Windows PC?
Date: Thu, 4 Aug 2022 15:57:20 -0230
Organization: Mixmin
Message-ID: <tch31e$35g72$1@news.mixmin.net>
References: <tcbltf$1k5f$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=fixed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 4 Aug 2022 18:26:55 -0000 (UTC)
Injection-Info: news.mixmin.net; posting-host="a112537deea7100e63648454b2f8da25ce49846c";
logging-data="3326178"; mail-complaints-to="abuse@mixmin.net"
User-Agent: Usenapp/0.93/l for MacOS - Full License
 by: cris - Thu, 4 Aug 2022 18:27 UTC

Andy Burnelli <spam@nospam.com> wrote:

> How do we find the random Android wireless debugging port from a Windows PC?
>
> Or, if we can't find the exact port, maybe we can search a set of ports?

You and everyone else since Android 11 wants to know the same answer.
https://medium.com/@amanshuraikwar.in/connecting-to-android-device-with-adb-over-wifi-made-a-little-easy-39439d69b86b

If you can port this to Windows command line it might work but you might need to be an admin.
https://gist.githubusercontent.com/amanshuraikwar/384ed1a77b1c5bfe577c219297b5882e/raw/4d80e2e1f25d017276c298f076d4f7c86c442728/adbwificonnect.sh

# Purpose: Shell script to connect a USB connected device via adb over WiFi
#
# Author: Amanshu Raikwar
#
# Assumptions:
# 1. USB debugging is enabled in the Android device
# 2. The Android device is connected to the computer via USB
# 3. The Android device is connected to the same wifi as the computer
# 4. The Android device is accessible through port 5555 over the wifi network
#
# How To Use (without any options):
# 1. Paste the file where adb resides, for mac it is ~/Library/Android/sdk/platform-tools/
# 2. Run ./adbwificonnect
# 3. Choose the device by typing X in [X] --> ... when prompted
# 4. Wait around 6-7 seconds
# 5. Connected!
#
# Options:
# -a
# To connect to all available devices
#
# -d device_id
# Specifies the device id to be connected to

# if no command line params provided
if [ -z "$1" ]; then

clear

# list available devices
echo "Available devices:"
devices="$(./adb devices)"

export IFS=$'\n'

declare -a devicemap

i=0

# save device info in an array
for word in $devices; do
devicemap+=("$(echo $word | awk '{print $1}')")
echo "[$i] --> $word"
i=$((i+1))
done

# wait for user input to choose device
read -p "Choose device: " choice

# chosen device id
device=${devicemap[choice]}

devicename="$(./adb devices -l | grep $device | awk '{print $4}' | cut -d: -f2)"
devicemodel="$(./adb devices -l | grep $device | awk '{print $5}' | cut -d: -f2)"

echo "Connecting to device $device $devicename $devicemodel..."

# restart adb in tcpip mode for the device
./adb -s $device tcpip 5555

# wait for adb to restart
# note: this may change depending on the computer
sleep 5s

# find out the wlan0 ip of the device by running ifconfig in device's shell
ip="$(./adb -s $device shell ifconfig wlan0 | grep 'inet addr' | cut -d: -f2 | awk '{print $1}')"
echo "Connecting to $ip..."

# connect to the device
./adb connect $ip:5555

# connect to all available devices
elif [ $1 == "-a" ]; then

# list available devices
echo "Connecting to all available devices..."
devices="$(./adb devices)"

export IFS=$'\n'

declare -a devicemap

i=0

# iterate for each device and connect
for word in $devices; do

# device id
device=("$(echo $word | awk '{print $1}')")

# skip the first line
if [ "$i" != "0" ]; then

echo "---"

devicename="$(./adb devices -l | grep $device | awk '{print $4}' | cut -d: -f2)"
devicemodel="$(./adb devices -l | grep $device | awk '{print $5}' | cut -d: -f2)"

echo "Connecting to device $device $devicename $devicemodel..."

# restart adb in tcpip mode for the device
./adb -s $device tcpip 5555

# wait for adb to restart
# note: this may change depending on the machine
sleep 5s

# find out the wlan ip of the device by running ifconfig in device's shell
ip="$(./adb -s $device shell ifconfig wlan0 | grep 'inet addr' | cut -d: -f2 | awk '{print $1}')"
echo "Connecting to $ip..."

# connect to the device
./adb connect $ip:5555

fi

i=$((i+1))
done

# connect to a specific device
elif [ $1 == "-d" ]; then

if [ -z "$2" ]; then
echo "-d expects device id as the second parameter"
exit 1
fi

device="$2"

devicename="$(./adb devices -l | grep $device | awk '{print $4}' | cut -d: -f2)"
devicemodel="$(./adb devices -l | grep $device | awk '{print $5}' | cut -d: -f2)"

echo "Connecting to device $device $devicename $devicemodel..."

# restart adb in tcpip mode for the device
./adb -s $device tcpip 5555

# wait for adb to restart
# note: this may change depending on the machine
sleep 5s

# find out the wlan ip of the device by running ifconfig in device's shell
ip="$(./adb -s $device shell ifconfig wlan0 | grep 'inet addr' | cut -d: -f2 | awk '{print $1}')"
echo "Connecting to $ip..."

# connect to the device
./adb connect $ip:5555

else
echo "Flag '$1' is not supported!"
fi

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor