Android device: set Wifi Proxy with ADB command

Andres Sandoval
1 min readJul 10, 2020

Every time we configure Charles we need to manually configure device wifi proxy settings.

Manual steps to enable Charles:

Go to Wifi settings -> edit -> Proxy -> manual -> enter the “Proxy hostname” (IP address) -> enter the “Proxy port” (8888).

Automate with ADB command:

With this ADB command you can configure Proxy on device from the terminal. Change to use your IP address.

adb shell settings put global http_proxy 192.168.xx.xxx:8888

To remove the proxy setting enter below ADB command:

adb shell settings put global http_proxy :0

Note: you can create an alias to make the adb command shorter.

alias proxy='adb shell settings put global http_proxy 192.168.86.219:8888'

Thanks for reading. I started to publish my daily notes. Let me know if I’m wrong somewhere or if there’s something that could do differently or better. I’m open to your feedback 🙌🏻

Andres

References:

https://stackoverflow.com/questions/31807559/undo-setting-proxy-via-settings-global-in-android/47476009#47476009

--

--