Skip to content

Instantly share code, notes, and snippets.

@mateofumis
Created December 18, 2025 01:04
Show Gist options
  • Select an option

  • Save mateofumis/8a8115d82030a0c79b80c097fdabafcb to your computer and use it in GitHub Desktop.

Select an option

Save mateofumis/8a8115d82030a0c79b80c097fdabafcb to your computer and use it in GitHub Desktop.
proxyadb() function for .zshrc - Automated Android Proxy Management
# NOTE: Add this inside your .zshrc file
# Author: Mateo Fumis
proxyadb() {
if [[ "$1" == "--connect" ]]; then
if [[ -n "$2" && -n "$3" ]]; then
adb shell settings put global http_proxy "$2:$3"
echo "Proxy set to $2:$3"
else
echo "Please provide an IP address and a port."
fi
elif [[ "$1" == "--disconnect" ]]; then
adb shell settings put global http_proxy :0
echo "Proxy disconnected"
elif [[ "$1" == "--status" ]]; then
adb shell settings get global http_proxy
else
echo "Usage: proxyadb --connect <ip> <port> | --disconnect | --status"
fi
}
_proxyadb_completions() {
local -a completions
completions=(
'--connect'
'--disconnect'
'--status'
)
_describe 'proxyadb options' completions
}
compdef _proxyadb_completions proxyadb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment