使用adb设置代理

问题描述 投票:0回答:2

我发现这些命令可以使用 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

是否还可以添加

same
命令或
another
、代理
username
password

Atm 会弹出一个窗口,要求输入此信息,但我也想使用 ADB 添加它。

android adb
2个回答
5
投票

你尝试过吗:

启用带有身份验证的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

并禁用代理:

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

相关来源:


1
投票

一个 Android 应用程序,使用 adb 设置 wifi 接入点的代理设置。这不需要 root,并且可以与任何具有 USB 调试功能的设备或任何模拟器(包括 Genymotion)一起使用。

链接

样品

adb shell am start -n tk.elevenk.proxysetter/.MainActivity -e host 192.168.56.1 -e port 8080 -e ssid PublicWifi -e bypass test.com,test2.com -e reset-wifi true
最新问题
© www.soinside.com 2019 - 2025. All rights reserved.