[转] - Configuring Android Studio: IDE & VM Options, JDK, etc

Configuring Android Studio: IDE & VM Options, JDK, etc

You should not edit any files in the IDE installation directory. Instead, you can customize the attributes by creating your own .properties or .vmoptions files in the following directories. (This has been possible on some platforms before, but it required you to copy and change the entire contents of the files. With the latest changes these properties are now additive instead such that you can set just the attributes you care about, and the rest will use the defaults from the IDE installation).

Note: The folder name depends on the version of Android Studio. The documentation below applies to the release version (1.1.x), but if you are on a different version of Android Studio, see the table below for the correct folder name for your version.

The following table shows the configuration folder name to use for each studio version. This folder is referenced below as {FOLDER_NAME}

 Android Studio Version
 Preferences Folder Name
 1.0.x and 1.1.x  AndroidStudio
 1.2.0 EAP/Preview  AndroidStudioPreview1.2
 1.2.0, 1.2.1, 1.2.2  AndroidStudio1.2
 1.3 Preview  AndroidStudioPreview1.3
 1.3.0, 1.3.1, 1.3.2  AndroidStudio1.3
 1.4.0 EAP/Preview (Future)  AndroidStudioPreview1.4

Windows:

  • %USERPROFILE%\.{FOLDER_NAME}\studio.exe.vmoptions and/or %USERPROFILE%\.{FOLDER_NAME}\studio64.exe.vmoptions
  • %USERPROFILE%\.{FOLDER_NAME}\idea.properties

Mac:

  • ~/Library/Preferences/{FOLDER_NAME}/studio.vmoptions
  • ~/Library/Preferences/{FOLDER_NAME}/idea.properties

Linux:

  • ~/.{FOLDER_NAME}/studio.vmoptions and/or ~/.{FOLDER_NAME}/studio64.vmoptions
  • ~/.{FOLDER_NAME}/idea.properties

You can also place use environment variables to point to specific override files elsewhere:

  • STUDIO_VM_OPTIONS, which vmoptions file to use
  • STUDIO_PROPERTIES, which property file to use
  • STUDIO_JDK, which JDK to run studio with

Note that this last variable allows you to for example run Android Studio with Java 7 on OSX (which normally picks Java 6 from the version specified in Info.plist):

$ export STUDIO_JDK=/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk

$ open /Applications/Android\ Studio.app

(For Mac in particular, see this document on the topic of JDK selection.)

Increasing IDE Memory

By default, the IDE is assigned a maximum of 750 MB. If you have a large project, or if you have a lot of RAM on your system, the IDE will run better if you increase the amount of memory it is allowed to use. To do that, create your own studio.vmoptions override (in the location explained above) and add a line like this:

-Xmx2048m

The full set of default JVM arguments are the following, in case you want to override any of the others (such as the start heap size of the MaxPermSize) :defaults in the IDE right

-Xms128m
-Xmx750m
-XX:MaxPermSize=350m
-XX:ReservedCodeCacheSize=96m
-XX:+UseCompressedOops

Help, I Already Edited the IDE Installation Files

If you‘ve already edited the files by hand, here are the files from 1.0 such that you can restore them:

Android Studio is Ignoring My idea.vmoptions File

Around 1.0 we switched from storing VM options in a file called idea.vmoptions to one called studio.vmoptions, to avoid clashing with IntelliJ installations. If you had created a file named idea.vmoptions for Studio, it will be ignored now. Put your edits in studio.vmoptions instead.

Properties

Here are properties you can customize in your own idea.properties file:

#---------------------------------------------------------------------

# Uncomment this option if you want to customize path to user installed plugins folder. Make sure 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 system memory requirements are

# if code assistance is enabled. Remove this property or set to very large number if you need

# code assistance for any files available regardless their size.

#---------------------------------------------------------------------

idea.max.intellisense.filesize=2500

#---------------------------------------------------------------------

# This option controls console cyclic buffer: keeps the console output size not higher than the specified buffer size (Kb).

# Older lines are deleted. In order to disable cycle buffer use idea.cycle.buffer.size=disabled

#---------------------------------------------------------------------

idea.cycle.buffer.size=1024

#---------------------------------------------------------------------

# Configure if a special launcher should be used when running processes from within IDE.

# Using Launcher enables "soft exit" and "thread dump" features

#---------------------------------------------------------------------

idea.no.launcher=false

#---------------------------------------------------------------------

# To avoid too long classpath

#---------------------------------------------------------------------

idea.dynamic.classpath=false

#---------------------------------------------------------------------

# There are two possible values of idea.popup.weight property: "heavy" and "medium".

# If you have WM configured as "Focus follows mouse with Auto Raise" then you have to

# set this property to "medium". It prevents problems with popup menus on some

# 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 useful when using Windows Remote Desktop Connection for instance.

#---------------------------------------------------------------------

idea.use.default.antialiasing.in.editor=false

#---------------------------------------------------------------------

# Disabling this property may lead to visual glitches like blinking and fail to repaint

# on certain display adapter cards.

#---------------------------------------------------------------------

sun.java2d.noddraw=true

#---------------------------------------------------------------------

# Removing this property may lead to editor performance degradation under Windows.

#---------------------------------------------------------------------

sun.java2d.d3d=false

#---------------------------------------------------------------------

# Workaround for slow scrolling in JDK6

#---------------------------------------------------------------------

swing.bufferPerWindow=false

#---------------------------------------------------------------------

# Removing this property may lead to editor performance degradation under X Window.

#---------------------------------------------------------------------

sun.java2d.pmoffscreen=false

#---------------------------------------------------------------------

# 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

 

#---------------------------------------------------------------------

# High Density (aka Retina aka HiDPI) Display support:

#

# The two options below allow overriding the built-in HiDPI display detection

# algorithm to provide a custom system DPI.

# The options are not supported on Mac, as Retina support is built-in.

#

# hidpi.system.dpi.override=<dpi_value>

# where <dpi_value> can range from 96 (100% zoom), to 288 (300%) zoom. 

#

# hidpi=true is a legacy option that is equivalent to setting

hidpi.system.dpi.override=192 (200% zoom)

#---------------------------------------------------------------------

#hidpi.system.dpi.override=192

#hidpi=true

Subpages (1): Mac OSX JDK Selection

http://tools.android.com/tech-docs/configuration

时间: 2024-10-13 04:14:16

[转] - Configuring Android Studio: IDE & VM Options, JDK, etc的相关文章

Android Studio IDE 简单学习和介绍

1.下载安装请自行去Android 官放网站去下载,建议FQ. 2.eclipse 和 AS 的差异 (1)android studio是单工程的开发模式 (2)android studio中的application相当于eclipse里的workspace概念 (3)android studio中的module相当于eclipse里的project概念 3.新建工程后AS 的 project 目录简单介绍. (1).idea://AS生成的工程配置文件,类似Eclipse的project.pr

Android Studio的使用 及 JDK环境配置(Window10 64位)

想玩Android Studio,首先需要先解决环境问题,这边首先说JDK环境配置,针对全新环境. 一: 1.先通过右击电脑属性,查看自己电脑系统类型,我的是Win10 64位环境,已经下载如下图jdk安装包, 2.jdk安装,双击安装,基本都是下一步,期间要注意的是安装的位置(后面环境配置要用到),我是用了一个记事本记录了jdk安装路径,如下图所示: 3.JDK安装成功测试,win+R输入CMD回车,然后输入java -version,如下图所示即按照JDK成功. 4.JDK环境变量的配置(右

Android Studio IDE Out of Memory

场景: 尝试过各种方式,IDE重装,重新启动,设置IDE MEMORY大小JDK MEMORY大小都无效 终于在FILE->INVALIDATE CACHES/RESTART 中点击重新启动之后问题攻克了.

Android Studio IDE 显示代码行号

每次在需要重新配置android studio的时候总是会要去查询行号怎么现实出来,在这里记录下来,方便大家也方便自己 从file->settings 进入下面的界面

Android Studio IDE 按下Ctrl + 鼠标滚动 缩放编辑文本的大小

Settings->Editor->General 勾选Change font size(Zoom)with Ctrl+Mouse Wheel!

怎样将极光推送第三方导入到Android studio IDE中

1.导入文件 将第三方文件(如下图)复制到项目app->libs中 2.添加引用 右键文件“jpush-sdk-release1.7.3.jar"-  什么 as Library,添加引用 3.编辑build.gradle文件 添加如下代码 sourceSets { main { jniLibs.srcDirs = ['libs'] } } 大功告成!

Android Studio IDE的 LogCat如何过滤指定应用的调试信息

http://blog.csdn.net/wangqing830414/article/details/40377979 打开 LogCat在搜索框右侧的No Filters中选择 Edit Filter Configuration选项 然后在Name中输入过滤器的名称,在by Package Name中输入你的应用的Package Name就可以了. 如下图 然后在搜索框右侧的过滤器选项中选择你刚选择过滤器就可以了.

初探Android Studio

作为资深eclipse用户,还没有接触过studio,可是明显感觉到Studio的崛起,越来越多的开发者投入到了Studio的怀抱,从网上下载一个Demo,stuido,再下载一个还是studio...,于是到了忍无可忍的地步,果断开始studio的学习之路.由于是初次接触,就写下我的探索学习之路吧.为还没有接触过的Studio的童鞋提供一点点方便,大神绕道... 当然,第一步,下载安装建一个Helloword,这样就算入门了. 先提供一个可用的下载地址,Linux公社的百度网盘分享,还有其他很

Android Studio 简单设置

界面设置 默认的 Android Studio 为灰色界面,可以选择使用炫酷的黑色界面.Settings --> Appearance --> Theme ,选择 Darcula 主题即可. 字体设置 系统字体设置 如果你的Android Studio界面中,中文显示有问题,或者选择中文目录显示有问题,或者想修改菜单栏的字体,可以这么设置.Settings --> Appearance ,勾选 Override default fonts by (not recommended) ,选择