不同目录的 Android Studio 路径

Posted

技术标签:

【中文标题】不同目录的 Android Studio 路径【英文标题】:Android Studio path to different directories 【发布时间】:2014-04-12 14:52:23 【问题描述】:

今天我想清理安装了 Windows 的 SSD,我发现在 C:\Users\SonneXo 一个文件夹(1.6 GB),我想更改它: .AndroidStudioPreview 我搜索了它,互联网建议我更改 idea.properties 中的设置,我这样做了:

#---------------------------------------------------------------------
# Uncomment this option if you want to customize path to IDE config folder. Make sure you're using forward slashes.
#---------------------------------------------------------------------
D:/android/.AndroidStudioPreview/config

#---------------------------------------------------------------------
# Uncomment this option if you want to customize path to IDE system folder. Make sure you're using forward slashes.
#---------------------------------------------------------------------
D:/Android/.AndroidStudioPreview/system

我将完整的文件夹从 C:\Users\SonneXo.AndroidStudioPreview 复制到 D:\Android.AndroidStudioPreview,我启动了 Android Studio,它告诉我应该导入设置完成安装。

所以我猜有些事情不对劲。与我从介绍中删除 # 时出现的相同。

如果我没有选择要导入设置的文件夹,sdk 会创建新的 .AndroidStudioPreview 文件夹,如果我选择新位置,似乎会将其中的一部分复制回 C:\Users\SonneXo.

有人有同样的问题和建议吗?

到目前为止有一个愉快的星期天;D

【问题讨论】:

【参考方案1】:

从 Android Studio 1.4 开始,您无需覆盖系统的 idea.properties。您可以只使用您需要的覆盖来创建您的idea.properties

对我来说是:

idea.properties%USERPROFILE%\.FOLDER_NAME\idea.properties

idea.config.path=d:/Android/AndroidStudio/config/
idea.system.path=d:/Android/AndroidStudio/system/

您可以在http://tools.android.com/tech-docs/configuration阅读 Google 的完整说明

编辑:%USERPROFILE%\.FOLDER_NAME\ 的文件 idea.properties 不会自动创建。您需要手动创建它。

【讨论】:

该链接中的信息对于 android 1.4 不准确。启动 android studio 时,%USERPROFILE%\.FOLDER_NAME` 只创建了 2 个文件夹,即systemconfig。本地没有idea.properties文件,安装目录下bin\ 下的文件只有两行代码。那么必须修改什么来改变这些本地文件夹的位置呢? 哦,对不起,忘了说。我手动创建了idea.properties 文件。【参考方案2】:

将您的idea.properties 替换为下面的内容并检查

idea.properties

# Use $idea.home macro to specify location relative to IDE installation home.
# Use $xxx where xxx is any Java property (including defined in previous lines of this file) to refer to its value.
# Note for Windows users: please make sure you're using forward slashes (e.g. c:/idea/system).

#---------------------------------------------------------------------
# Uncomment this option if you want to customize path to IDE config folder. Make sure you're using forward slashes.
#---------------------------------------------------------------------
# idea.config.path=$user.home/.AndroidStudioPreview/config

 idea.config.path=D:/Android/.AndroidStudioPreview/config

#---------------------------------------------------------------------
# Uncomment this option if you want to customize path to IDE system folder. Make sure you're using forward slashes.
#---------------------------------------------------------------------
idea.system.path=D:/Android/.AndroidStudioPreview/system

#---------------------------------------------------------------------
# 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

#---------------------------------------------------------------------
# Uncomment this option if you want to customize path to IDE logs folder. Make sure you're using forward slashes.
#---------------------------------------------------------------------
# idea.log.path=$idea.system.path/log

#---------------------------------------------------------------------
# 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

#---------------------------------------------------------------------
# Uncomment this property to prevent IDE from throwing ProcessCanceledException when user activity
# detected. This option is only useful for plugin developers, while debugging PSI related activities
# performed in background error analysis thread.
# DO NOT UNCOMMENT THIS UNLESS YOU'RE DEBUGGING IDE ITSELF. Significant slowdowns and lockups will happen otherwise.
#---------------------------------------------------------------------
#idea.ProcessCanceledException=disabled

#---------------------------------------------------------------------
# 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
#---------------------------------------------------------------------
# IDEA can copy library .jar files to prevent their locking.
# By default this behavior is enabled on Windows and disabled on other platforms.
# Uncomment this property to override.
#---------------------------------------------------------------------
# idea.jars.nocopy=false

#---------------------------------------------------------------------
# The VM option value to be used to start a JVM in debug mode.
# Some JREs define it in a different way (-XXdebug in Oracle VM)
#---------------------------------------------------------------------
idea.xdebug.key=-Xdebug

#-----------------------------------------------------------------------
# Change to 'disabled' if you don't want to receive instant visual notifications
# about fatal errors that happen to an IDE or plugins installed.
#-----------------------------------------------------------------------
idea.fatal.error.notification=enabled

在文件资源管理器中尝试此路径一次,以交叉检查路径是否正确。

D:\Android\.AndroidStudioPreview\config

【讨论】:

非常喜欢的朋友 :) 不适用于 Windows 上的 AndroidStudio1.4,可能需要编辑注册表以阻止应用程序不断在用户主目录中创建 .AndroidStudio1.4 文件夹。 不确定,没试过。 我花了很多时间试图找出更改config folder 的方法并找到了。谢谢! @T.Todua 很高兴知道它对您有所帮助。

以上是关于不同目录的 Android Studio 路径的主要内容,如果未能解决你的问题,请参考以下文章

错误记录Android Studio 编译报错 ( Module was compiled with an incompatible version of Kotlin. ) 2

安装android studio出现choose an account with administt

在同一目录位置找不到文件夹的路径 - Android Studio

Android Studio保存log到本地

安装andriod studio时出现Internal error. Please report to https://code.google.com/p/an

Android获取本地路径问题 android studio 4.2 新建res/raw目录 android中读取Raw资源 Android Bundle传递数据,传对象和List(需要序列化)