Configure Android Studio
Configure Android Studio
Configure Android Studio
In this document
Find your conguration les
Customize your VM options
Maximum heap size
Customize your IDE
properties
Set the JDK version
Set proxy settings
(#customize_vm):
(#customize_ide):
Windows: %USERPROFILE%\.<CONFIGURATION_FOLDER>/
Mac: ~/Library/Preferences/<CONFIGURATION_FOLDER>/
Linux: ~/.<CONFIGURATION_FOLDER>/
You can also use the following environment variables to point to specic override
les elsewhere:
STUDIO_VM_OPTIONS: set the name and location of the .vmoptions le
STUDIO_PROPERTIES: set the name and location of the .properties le
STUDIO_JDK: set the JDK with which to run Studio
installation folder.
Note that you should never directly edit the studio.vmoptions le found inside the
Android Studio program folder. While you can access the le to view Studio's
default VM options, editing only your own studio.vmoptions le ensures that you
don't override important default settings for Android Studio. Therefore, in your
studio.vmoptions le, override only the attributes you care about and allow
Android Studio to continue using default values for any attributes you have not
changed.
3. Save your changes to the studio.vmoptions le, and restart Android Studio for
your changes to take effect.
4. To conrm your new maximum heap size, open the command line, and type the
following command:
jps -lvm
You will see a list of the instrumented JVMs running on your machine, including
the full package name for each and the arguments passed in. Locate the item
corresponding to your instance of Android Studio. It should end with
-Didea.paths.selector=AndroidStudio[Version]. You should see two
arguments beginning with -Xmx for this JVM, one with the default value of
1280mb, and one with your new value, as shown in gure 1.
Figure 1. The terminal output showing the current arguments for Android Studio's JVM.
The -Xmx argument showing the default maximum heap size, in this case
1280m.
The -Didea.paths.selector showing the version of Android Studio
currently running.
The -Xmx argument showing the new custom maximum heap size. Note
that this is followed by the location the custom studio.vmoptions le
you created above.
#--------------------------------------------------------------------# Uncomment this option if you want to customize path to user installed p
# you're using forward slashes.
#--------------------------------------------------------------------# idea.plugins.path=${idea.config.path}/plugins
#--------------------------------------------------------------------# Maximum file size (kilobytes) IDE should provide code assistance for.
# The larger file is the slower its editor works and higher overall syste
# if code assistance is enabled. Remove this property or set to very larg
# code assistance for any files available regardless their size.
#--------------------------------------------------------------------idea.max.intellisense.filesize=2500
#---------------------------------------------------------------------
# This option controls console cyclic buffer: keeps the console output si
# specified buffer size (Kb). Older lines are deleted. In order to disabl
# idea.cycle.buffer.size=disabled
#--------------------------------------------------------------------idea.cycle.buffer.size=1024
#--------------------------------------------------------------------# Configure if a special launcher should be used when running processes f
# Using Launcher enables "soft exit" and "thread dump" features
#--------------------------------------------------------------------idea.nnoo.launcher=ffaallssee
#--------------------------------------------------------------------# To avoid too long classpath
#--------------------------------------------------------------------idea.ddyynnaammiicc.classpath=ffaallssee
#--------------------------------------------------------------------# There are two possible values of idea.popup.weight property: "heavy" an
# If you have WM configured as "Focus follows mouse with Auto Raise" then
# set this property to "medium". It prevents problems with popup menus on
# configurations.
#--------------------------------------------------------------------idea.popup.weight=heavy
#--------------------------------------------------------------------# Use default anti-aliasing in system, i.e. override value of
# "Settings|Editor|Appearance|Use anti-aliased font" option. May be usefu
# Remote Desktop Connection for instance.
#--------------------------------------------------------------------idea.uussee.ddeeffaauulltt.antialiasing.iinn.editor=ffaallssee
#--------------------------------------------------------------------# Disabling this property may lead to visual glitches like blinking and f
# on certain display adapter cards.
#--------------------------------------------------------------------sun.java2d.noddraw=ttrruuee
#--------------------------------------------------------------------# Removing this property may lead to editor performance degradation under
#--------------------------------------------------------------------sun.java2d.d3d=ffaallssee
#--------------------------------------------------------------------# Workaround for slow scrolling in JDK6
#--------------------------------------------------------------------swing.bufferPerWindow=ffaallssee
#--------------------------------------------------------------------# Removing this property may lead to editor performance degradation under
#--------------------------------------------------------------------sun.java2d.pmoffscreen=ffaallssee
#--------------------------------------------------------------------# Workaround to avoid long hangs while accessing clipboard under Mac OS X
#--------------------------------------------------------------------# ide.mac.useNativeClipboard=True
#--------------------------------------------------------------------# Maximum size (kilobytes) IDEA will load for showing past file contents
# in Show Diff or when calculating Digest Diff
#--------------------------------------------------------------------# idea.max.vcs.loaded.size.kb=20480
android {
compileOptions {
sourceCompatibility JJaavvaaVVeerrssiioonn.VERSION_1_6
targetCompatibility JJaavvaaVVeerrssiioonn.VERSION_1_6
}
}
For more information about where compileSdkVersion is dened, read about the
module-level build le (https://developer.android.com/studio/build/index.html#module-level).
To support running Android Studio behind a rewall, set the proxy settings for the
Android Studio IDE. Use the Android Studio IDE HTTP Proxy settings page to set the
HTTP proxy settings for Android Studio.
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 le.
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.
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 le.
For information about using Gradle properties for proxy settings, see the Gradle
User Guide (http://www.gradle.org/docs/current/userguide/build_environment.html).
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
le.