删除全局http_proxy,而无需重新启动Android设备

时间:2019-07-01 06:24:05

标签: android proxy adb http-proxy

我使用following code通过命令行工具adb设置Android HTTP代理。

adb shell settings put global http_proxy <ip>:<port>

但是,当我要撤消代理设置时,以下代码不会删除代理。尽管Android设备清除了这些系统属性,但仍尝试尝试连接<ip>:<port>

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

我必须重新启动Android设备才能删除代理。有没有不重新启动设备就清理代理的方法?

Android版本是7.0。

重现此问题:

# Set up a proxy
adb shell settings put global http_proxy <ip>:<port>

# Remove them
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

# Then open a browser, it will still connect to the proxy ip and port

1 个答案:

答案 0 :(得分:3)

要做:

~$ adb shell settings put global http_proxy :0