-
-
Save HugoGresse/a3c315c3c4eb454a2e89d0b5642ffcbe 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 |
i've updated the gist with the comment of @superbsocial
To remove proxy setting instantly use below command. It will be take effect without reboot
adb shell settings put global http_proxy :0works good. but any solution to remove proxy without restarting device?
How to run this script btw?
it's a bash script, so:
./adbx proxy set
./adbx proxy remove
is there any thin similer for ios ?
is there any thin similer for ios ?
No idea sorry.
@HugoGresse any idea of how to implement one on proxy that's require authentication i found this but seem not working or its working or I have no idea but when I set proxy with it and I use for example browser its ask for auth for proxy
@elmissouri16 no idea.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thx!