Android device: set Wifi Proxy with ADB command

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

software engineer, read, swim, travel. apps: https://goo.gl/rDuuQw https://goo.gl/15GvfE

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store