proxy-cleanup-script

Android Proxy Cleanup Script

Purpose

Clear all proxy settings from an Android device via ADB, removing leftover HTTP/HTTPS proxy configurations that may interfere with normal browser/app connectivity.

Prerequisites

Commands

Full Cleanup Sequence

#!/usr/bin/env bash
set -euo pipefail

adb shell settings delete global http_proxy || true
adb shell settings delete global global_http_proxy_host || true
adb shell settings delete global global_http_proxy_port || true
adb shell settings delete global global_http_proxy_exclusion_list || true
adb reverse --remove-all || true
adb shell am force-stop com.android.chrome || true

echo "Remaining proxy-related globals:"
adb shell settings list global | rg 'proxy' || true

Command Breakdown

Command Purpose
adb shell settings delete global http_proxy Remove legacy HTTP proxy setting
adb shell settings delete global global_http_proxy_host Remove proxy hostname
adb shell settings delete global global_http_proxy_port Remove proxy port
adb shell settings delete global global_http_proxy_exclusion_list Remove proxy exclusion list
adb reverse --remove-all Remove all reverse-proxy port mappings
adb shell am force-stop com.android.chrome Force-stop Chrome to clear cached proxy state
adb shell settings list global | rg 'proxy' Verify no proxy settings remain

Execution

Save as proxy-cleanup.sh:

chmod +x proxy-cleanup.sh
./proxy-cleanup.sh

Expected Output

After cleanup, adb shell settings list global | grep proxy should return only:

global_proxy_pac_url=

This empty PAC URL setting is normal and does not interfere with connectivity.

Use Cases

Safety Notes

See proxy-cleanup-2026-05-22.md for a real-world example and troubleshooting steps.