Skip to content

Instantly share code, notes, and snippets.

@Leeonardoo
Created April 4, 2022 11:56
Show Gist options
  • Save Leeonardoo/850f3ffb9b51ab3388eb61ca1daec384 to your computer and use it in GitHub Desktop.
Save Leeonardoo/850f3ffb9b51ab3388eb61ca1daec384 to your computer and use it in GitHub Desktop.
ADB-All and localhost port forwarding
#!/bin/bash
# Place it on /usr/bin/
adb devices | while read line
do
if [ ! "$line" = "" ] && [ `echo $line | awk '{print $2}'` = "device" ]
then
device=`echo $line | awk '{print $1}'`
echo "$device $@ ..."
adb -s $device $@
fi
done
#!/bin/bash
# Place it on /usr/bin/
adb-all reverse tcp:3000 tcp:3000
adb-all reverse tcp:80 tcp:80
adb-all reverse tcp:8080 tcp:8080
adb-all reverse tcp:8088 tcp:8088
adb-all reverse tcp:443 tcp:443
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment