-
-
Save kikyous/3a1f9f9a057fc78e38068e930a99e88d to your computer and use it in GitHub Desktop.
Adb command to set proxy (WIP)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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