android studio 代理设置

原址:http://developer.android.com/tools/studio/studio-config.html


Configuration

During installation, Android Studio provides wizards and templates that verify your system requirements, such as the Java Development Kit (JDK) and available RAM, and configure default settings, such as an optimized default Android Virtual Device (AVD) emulation and updated system images. This document describes additional configuration settings you may want to use to customize your use of Android Studio.

For specific documentation about emulator and device setup and use, seeManaging Virtual DevicesUsing Hardware Devices, and OEM USB Drivers.

Update channels


Android Studio provides four update channels to keep Android Studio up-to-date based on your code-level preference:

  • Canary channel: Canary builds provide bleeding edge releases, updated about weekly. While these builds do get tested, they are still subject to bugs, as we want people to see what's new as soon as possible. This is not recommended for production.
  • Dev channel: Dev builds are hand-picked older canary builds that survived the test of time. They are updated roughly bi-weekly or monthly.
  • Beta channel: Beta builds are used for beta-quality releases before a production release.
  • Stable channel: Used for stable, production-ready versions.

By default, Android Studio uses the Stable channel. Use File > Settings > Appearance & Behavior System Settings > Updates to change your channel setting.


主要说有四个升级选项,建议使用stable channel,

File > Settings > Appearance & Behavior System Settings > Updates

更改选项

Proxy Settings


Proxies serve as intermediary connection points between HTTP clients and web servers that add security and privacy to internet connections.

To support running Android Studio behind a firewall, set the proxy settings for the Android Studio IDE and the SDK Manager. Use the Android Studio IDE HTTP Proxy settings page to set the HTTP proxy settings for Android Studio. The SDK Manager has a separate HTTP Proxy settings page.

When running the Android Plugin for Gradle from the command line or on machines where Android Studio is not installed, such as continuous integration servers, set the proxy settings in the Gradle build file.

Note: After the initial installation of the Android Studio bundle, Android Studio can run with internet access or off-line. However, Android Studio requires an internet connection for Setup Wizard synchronization, 3rd-party library access, access to remote repositories, Gradle initialization and synchronization, and Android Studio version updates.

Setting up the Android Studio Proxy

Android Studio supports HTTP proxy settings so you can run Android Studio behind a firewall or secure network. To set the HTTP proxy settings in Android Studio:

  1. From the main menu choose File > Settings > Appearance & Behavior -- System Settings -- HTTP Proxy.
  2. In Android Studio, open the IDE Settings dialog.
  3. 设置ide http代理方法
    • On Windows and Linux, choose File > Settings > IDE Setting -- HTTP Proxy.
    • On Mac, choose Android Studio > Preferences > IDE Setting -- HTTP Proxy.
    The HTTP Proxy page appears.
  4. Select auto-detection to use an auto-configuration URL to configure the proxy settings or manual to enter each of the settings. For a detailed explanation of these settings, see HTTP Proxy.
  5. Click Apply to enable the proxy settings.

Android Plugin for Gradle HTTP proxy settings

When running the Android Plugin from the command line or on machines where Android Studio is not installed, set the Android Plugin for Gradle proxy settings in the Gradle build file.
给当前项目设置http或者https代理,可以在当前模块的build.gradle中设置 ,或者在项目的   gradle/gradle.properties中设置,主要用于下载一些引用的项目,或者gradle自身的更新等.

For application-specific HTTP proxy settings, set the proxy settings in the build.gradle file as required for each application module.

apply plugin: 'com.android.application'

android {
    ...

    defaultConfig {
        ...
        systemProp.http.proxyHost=proxy.company.com
        systemProp.http.proxyPort=443
        systemProp.http.proxyUser=userid
        systemProp.http.proxyPassword=password
        systemProp.http.auth.ntlm.domain=domain
    }
    ...
}

For project-wide HTTP proxy settings, set the proxy settings in the gradle/gradle.properties file.

# Project-wide Gradle settings.
...

systemProp.http.proxyHost=proxy.company.com
systemProp.http.proxyPort=443
systemProp.http.proxyUser=username
systemProp.http.proxyPassword=password
systemProp.http.auth.ntlm.domain=domain

systemProp.https.proxyHost=proxy.company.com
systemProp.https.proxyPort=443
systemProp.https.proxyUser=username
systemProp.https.proxyPassword=password
systemProp.https.auth.ntlm.domain=domain

...

For information about using Gradle properties for proxy settings, see the Gradle User Guide.

Note: When using Android Studio, the settings in the Android Studio IDE HTTP proxy settings page override the HTTP proxy settings in the gradle.properties file.

SDK Manager HTTP Proxy Settings

SDK Manager proxy settings enable proxy internet access for Android package and library updates from SDK Manager packages.

To set the SDK Manager settings for proxy internet access, start the SDK Manager and open the SDK Manager page.


看重点,更新sdk时  代理设置方法

  • On Windows, select Tools > Options from the menu bar.
  • On Mac and Linux, choose Tools > Options from the system menu bar.

The Android SDK Manager page appears. Enter the settings and click Apply.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值