当前位置:K88软件开发文章中心编程语言LinuxLinux01 → 文章内容

Android Studio设置socks5代理

减小字体 增大字体 作者:佚名  来源:网上搜集  发布时间:2019-1-4 9:03:27

-->

为什么要用代理

如今android studio越来越流行,很多的android程序猿都开始转入anroid studio的大本营。但是GFW的封锁成为很多人的困扰,eg:无法更新sdk,无法使用如下方式添加类库:

compile ‘com.android.support:support-v4:23.0.0’
compile ‘com.android.support:appcompat-v7:23.0.0’
compile ‘com.android.support:design:23.0.0’


如何设置代理

下面,开始讲如何设置android studio的shadowsoc**代理:
File–>Settings… 按照下图配置

  1. 设置自动代理

    This will attempt to user your system settings and is useful if your system uses a proxy autoconfiguratioin file(.pac)

    • 勾选 Auto-detect proxy settings后android studio会自动走你操作系统设置的代理。
    • 勾选Automatic proxy configuration URL并设置本地pac文件

  2. 设置手动代理
    由于ShadowSoc**是socks方式所以需要按照下图的方式配置
    点击ok后会在项目根目录的gradle.properties文件中生成如下代码:

systemProp.http.proxyHost=127.0.0.1
systemProp.http.proxyPort=1080

  1.  

    到此,就配置完毕了。


Android Studio设置socks5代理