我发现这些命令可以使用 ADB 添加/删除代理:
#To Add Proxy
adb shell settings put global http_proxy 192.168.1.252:8080
#To Remove Proxy
adb shell settings put global http_proxy :0
Run Code Online (Sandbox Code Playgroud)
same是否还可以在命令 或中添加another代理username和password?
Atm 会弹出一个窗口,要求输入此信息,但我还想使用 ADB 添加它。
你有没有尝试过:
启用带身份验证的 http 代理:
adb shell settings put global http_proxy 192.168.225.100:3128
adb shell settings put global global_http_proxy_host 192.168.225.100
adb shell settings put global global_http_proxy_port 3128
adb shell settings put global global_http_proxy_username foo
adb shell settings put global global_http_proxy_password bar
Run Code Online (Sandbox Code Playgroud)
并禁用代理:
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
adb shell settings delete global global_http_proxy_username
adb shell settings delete global global_http_proxy_password
adb shell settings delete global global_http_proxy_exclusion_list
adb shell settings delete global global_proxy_pac_url
adb shell reboot
Run Code Online (Sandbox Code Playgroud)
相关来源: