【问题标题】:Remove the global http_proxy without rebooting the Android device在不重启安卓设备的情况下移除全局 http_proxy
【发布时间】:2019-07-01 06:24:05
【问题描述】:

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

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

但是,当我想撤消代理设置时,以下代码不会删除代理。虽然清除了那些系统属性,但安卓设备还是会尝试连接&lt;ip&gt;:&lt;port&gt;

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

【问题讨论】:

    标签: android proxy adb http-proxy


    【解决方案1】:

    做:

    ~$ adb shell settings put global http_proxy :0
    

    【讨论】:

    • 谢谢,您在哪里找到了这个解决方案?我认为它不在文档中。我们还需要删除http_proxy、global_http_proxy_port、global_http_proxy_host还是不需要?
    • @baptx 不记得我是在哪里看到这些信息的,但我想我在写这个答案时学到了(或想通了):android.stackexchange.com/a/217801/218526。 // 没有。冒号前的部分是被清除的主机。 0端口无效,不影响。
    猜你喜欢
    • 1970-01-01
    • 2012-03-09
    • 2012-01-30
    • 1970-01-01
    • 1970-01-01
    • 2011-08-23
    • 1970-01-01
    • 1970-01-01
    • 2021-08-06
    相关资源
    最近更新 更多