AndroidStudio设置代理(XX-Net)

2018-11-17  本文已影响25人  小木桨
  1. 打开XX-Net Config页面查看代理监听端口

    QQ20181117-153229@2x.png
  2. 打开AndroidStudio设置代理选项,将对应的ip和端口配置好,点OK。

QQ20181117-153353.png
  1. 找到xx-net证书文件CA.crt

    QQ20181117-153802@2x.png

    4.打开终端窗口,使用keytool命令导入XX-net证书至cacerts,一般AndroidStudio cacerts文件存放路径为:安装包下/jre/jdk/Contents/Home/jre/lib/security/cacerts

keytool -import -noprompt -trustcacerts -alias XX-net -file CA.crt -keystore /Applications/Android\ Studio2.2.app/Contents/jre/jdk/Contents/Home/jre/lib/security/cacerts -storepass changeit
  1. 到此为止配置完成,需要重启AndroidStuiod即可使用代理了。

    需要注意的是,在启用代理后,gradel会默认全局启用,配置文件在~/.gradle/gradle.properties,如果不需要使用代理,可以将代码注释掉以取消代理。

    ## For more details on how to configure your build environment visit
    # http://www.gradle.org/docs/current/userguide/build_environment.html
    #
    # Specifies the JVM arguments used for the daemon process.
    # The setting is particularly useful for tweaking memory settings.
    # Default value: -Xmx1024m -XX:MaxPermSize=256m
    # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
    #
    # When configured, Gradle will run in incubating parallel mode.
    # This option should only be used with decoupled projects. More details, visit
    # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
    # org.gradle.parallel=true
    #Sat Nov 17 14:48:32 CST 2018
    #systemProp.https.proxyPort=8087
    #systemProp.http.proxyHost=127.0.0.1
    #systemProp.https.proxyHost=127.0.0.1
    #systemProp.http.proxyPort=8087
    
    
上一篇 下一篇

猜你喜欢

热点阅读