Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting a proxy using adb

Tags:

android

adb

I found these commands to add/remove proxy using 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

Is possible to also add in the same command or another, the proxy username and password?

Atm it pops a window asking to input this info, but I would like to also add it using ADB.

like image 841
Cesar Avatar asked Dec 18 '25 09:12

Cesar


2 Answers

Have you tried:

Enable http proxy with authentication:

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

And to disable proxy:

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

Relevant sources:

  • Connect ADB Proxy with UserName and Password
like image 166
DialFrost Avatar answered Dec 24 '25 11:12

DialFrost


An android app that sets the proxy settings for a wifi access point by using adb. This DOES NOT require root and will work with any device that has USB debugging on or any emulator (including Genymotion).

link

sample

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
like image 40
snorlax Avatar answered Dec 24 '25 10:12

snorlax



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!