Skip to content

Instantly share code, notes, and snippets.

@waruqi
Last active April 3, 2024 16:51
Show Gist options
  • Save waruqi/d927538e1f24cd731f93cad5f60507f7 to your computer and use it in GitHub Desktop.
Save waruqi/d927538e1f24cd731f93cad5f60507f7 to your computer and use it in GitHub Desktop.
Set usb charles proxy for android
#!/bin/bash
if [ $1 == "1" ]; then
echo "start proxy on 127.0.0.1:8888"
adb reverse tcp:8888 tcp:8888
adb shell settings put global http_proxy 127.0.0.1:8888
adb shell settings put global https_proxy 127.0.0.1:8888
else
echo "stop proxy on 127.0.0.1:8888"
adb reverse --remove tcp:8888
adb shell settings put global http_proxy :0
adb shell settings put global https_proxy :0
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment