Android adb 設置移除代理

設置代理:

adb shell settings put global http_proxy ip:port

如:

adb shell settings put global http_proxy 127.0.0.1:8888

移除代理:

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 reboot
 

但是,adb shell settings delete global http_proxy,再有些沒有delete參數的設備上報錯?

Invalid command: delete

usage:  settings [--user NUM] get namespace key

        settings [--user NUM] put namespace key value

'namespace' is one of {system, secure, global}, case-insensitive

If '--user NUM' is not given, the operations are performed on the owner user.

解決方法,sqlite中找到settings.db,在數據庫中刪除代理信息(需要Root)

sqlite3 /data/data/com.android.providers.settings/databases/settings.db
sqlite> select * from global;
sqlite> delete from global where name="global_http_proxy_host";
sqlite> delete from global where name="global_http_proxy_port";
sqlite> delete from global where name="http_proxy"; 

然後重啓設備:reboot

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章