-
打开XX-Net Config页面查看代理监听端口
QQ20181117-153229@2x.png -
打开AndroidStudio设置代理选项,将对应的ip和端口配置好,点OK。
-
找到xx-net证书文件CA.crt
QQ20181117-153802@2x.png4.打开终端窗口,使用
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
-
-alias
参数后跟自定义的别名 -
-file
参数后跟需要导入的XX-net CA证书路径 -
-keystore
参数后跟cacerts路径 -
-storepass
参数后跟的是jdk默认证书的密码,默认是changeit
-
到此为止配置完成,需要重启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
网友评论