Skip to content

Instantly share code, notes, and snippets.

@kikyous
Forked from HugoGresse/adbx
Created January 6, 2021 05:17
Show Gist options
  • Save kikyous/3a1f9f9a057fc78e38068e930a99e88d to your computer and use it in GitHub Desktop.
Save kikyous/3a1f9f9a057fc78e38068e930a99e88d to your computer and use it in GitHub Desktop.
Adb command to set proxy (WIP)
#!/bin/bash
usage() {
echo "Usage:"
echo " adbx proxy set"
echo " adbx proxy get"
echo " adbx proxy remove"
}
if [ $# -lt 1 ]
then
usage
exit 1
fi
# adb shell settings get global http_proxy
case $1 in
proxy)
case $2 in
get) adb shell settings get global http_proxy;;
set)
ip=$(ipconfig getifaddr en0)
port=":8888"
adb shell settings put global http_proxy $ip$port;;
remove)
adb shell settings put global http_proxy :0;;
*) usage;;
esac
;;
*) usage;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment