adb 修改手机代理方式

一、使用全局命令
设置代理:

adb shell settings put global http_proxy 代理IP地址:端口号

如:

adb shell settings put global http_proxy 127.0.0.1:8888

移除代理:

adb shell settings delete global http_proxy

adb shell settings delete global global_http_proxy_host

adb shell settings delete global global_http_proxy_port

二、使用第三方apk
AndroidProxySetter工具可以帮助我们使用adb命令可以快速进行wifi代理的设置和清除
GitHub地址:

https://github.com/jpkrause/AndroidProxySetter
下好apk后,安装到手机

adb install proxy-setter-debug-0.2.1.apk

设置代理:

adb shell am start -n tk.elevenk.proxysetter/.MainActivity -e host 代理IP地址 -e port 端口号 -e ssid WIFI名称 -e reset-wifi true -e key WIFI密码

如:

adb shell am start -n tk.elevenk.proxysetter/.MainActivity -e host 127.0.0.1 -e port 8888 -e ssid YOUR-WIFI-NAME -e reset-wifi true -e key YOUR-WIFI-PASSWORD

 

移除代理:

adb shell settings delete global http_proxy

adb shell settings delete global global_http_proxy_host

adb shell settings delete global global_http_proxy_port

作者:你的名字_85b0
链接:https://www.jianshu.com/p/30ece9dd3e01
来源:简书
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。

赞 (1)