Many developers, testers, and privacy‑conscious users need every network request from an Android phone to pass through a proxy server – for debugging API traffic, applying corporate filters, or routing through a VPN‑like tunnel. Android’s UI only offers per‑Wi‑Fi‑network proxy configuration, which disappears when you switch networks or reboot. This tutorial shows how to create a truly system‑wide proxy that survives reboots, using only ADB commands – no rooting, no third‑party apps.
192.168.1.100:8888) that you can reach from the phone’s network.If you plan to use the proxy for mobile data as well, make sure the proxy server is reachable over cellular (public IP or port‑forwarded).
Android stores the global proxy in the global_http_proxy setting under the global namespace. The value is a string in the form host:port. When you set it via ADB, the system applies the proxy to all network interfaces, but the UI does not expose this flag, which is why many users think “Android has no system‑wide proxy”. The setting persists in /data/property/persist.sys.global_http_proxy (on most devices) and is reapplied at boot by the system server.
Open a terminal on your computer and run:
adb devices
You should see your device listed as device. If it shows unauthorized, check the phone for the RSA prompt and allow it.
Run the following command to see whether a global proxy is already set:
adb shell settings get global http_proxy
If the output is null or '', no proxy is active.
Replace PROXY_HOST and PROXY_PORT with your server’s address.
adb shell settings put global http_proxy PROXY_HOST:PROXY_PORT
Example:
adb shell settings put global http_proxy 192.168.1.100:8888
This command writes the value to the global settings database and updates the in‑memory configuration immediately.
On most stock Android builds the value written in step 3 is already persisted, but some OEM skins (e.g., Samsung One UI) clear it on boot. To guarantee persistence, also write the property directly:
adb shell setprop persist.sys.global_http_proxy PROXY_HOST:PROXY_PORT
Then, to ensure the system server picks up the change, restart the runtime:
adb shell stop && adb shell start
Alternatively, you can simply reboot the device; the proxy should remain active after the reboot.
Open a browser on the phone and visit a site that shows your IP address (e.g., https://ifconfig.me). The displayed IP should be that of your proxy server.
For a more technical check, you can capture traffic with adb logcat or use a proxy‑aware app like httping in Termux.
If you want the proxy to affect Wi‑Fi but not mobile data, you can combine the global setting with the per‑network setting. First, clear the global proxy:
adb shell settings delete global http_proxy
Then, for each Wi‑Fi network, use the UI (Settings > Network & Internet > Wi‑Fi > Network name > Advanced > Proxy) or the ADB command:
adb shell settings put global wifi_proxy PROXY_HOST:PROXY_PORT
Note that the wifi_proxy key is not documented and may not work on all OEMs; the UI method is more reliable.
To revert to the default (no proxy), run:
adb shell settings delete global http_proxy
adb shell setprop persist.sys.global_http_proxy ""
adb shell stop && adb shell start
After the restart, verify that adb shell settings get global http_proxy returns null.
The settings put global command writes directly to the SettingsProvider, which is the authoritative source for system properties. Android reads the http_proxy value at network stack initialization, so a reboot or a manual stop/start forces the runtime to reload the proxy.
However, some manufacturers ship a custom NetworkManagementService that resets the global proxy during their own boot scripts. In those cases, the setprop persist.sys.global_http_proxy line is essential because the property is read later in the boot sequence, after the OEM’s scripts.
persist.sys.global_http_proxy. Re‑apply the property and add it to the init.rc overlay via adb root (requires unlocked bootloader) or use a startup script in Termux:Boot as a workaround.user:pass@host:port) – however, many Android components strip the credentials for security. In such cases, a local proxy (e.g., proxifier) that adds auth headers is recommended.If you frequently toggle between a corporate proxy and a direct connection, a small batch or shell script can save time. Below is an example for Linux/macOS:
# set-proxy.sh
#!/bin/bash
DEVICE="$(adb get-serialno)"
if [ "$1" == "on" ]; then
HOST="192.168.1.100"
PORT="8888"
adb -s "$DEVICE" shell settings put global http_proxy "$HOST:$PORT"
adb -s "$DEVICE" shell setprop persist.sys.global_http_proxy "$HOST:$PORT"
echo "Proxy enabled: $HOST:$PORT"
else
adb -s "$DEVICE" shell settings delete global http_proxy
adb -s "$DEVICE" shell setprop persist.sys.global_http_proxy ""
echo "Proxy disabled"
fi
adb -s "$DEVICE" shell stop && adb -s "$DEVICE" shell start
Run ./set-proxy.sh on to enable and ./set-proxy.sh off to disable. Adjust the HOST and PORT variables for your environment.
The built‑in per‑Wi‑Fi proxy (Settings > Wi‑Fi > Network > Proxy) is sufficient for casual debugging on a single network. The ADB method shines when you need:
By following the steps above you now have a reliable, persistent system‑wide proxy on your Android device without rooting. The method works on most stock Android versions from 6.0 (Marshmallow) onward, and with minor adjustments on heavily customized OEM skins. Remember to verify the proxy after each reboot, keep your proxy server secure, and be aware of apps that may bypass the setting. With this knowledge you can debug network traffic, enforce corporate policies, or simply route your phone’s traffic through a privacy‑enhancing proxy whenever you need it.









