Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
98 views
in Technique[技术] by (71.8m points)

android - Is it possible to allocate these folders in another place?

I am installing Android Studio and I have by default the path C:UsersAdministratorAppDataLocalAndroidsdk to set my SDK. If I choose this option, some folders appeared on the path C:UsersAdministrator.

These folders are:

  • .android

  • .AndroidStudio1.3

  • .oracle_jre_usage

  • .gradle

To be a little more cleaner I tried to wrap all these folders into another folder but each time I run Android Studio it gives to me the option to configure again the settings. If I configure them again, the folders re-appeared on the path C:UsersAdministrator.

What can I do to wrap these folders into another one or to set another location for them and that the settings will be saved?


EDIT: I prove the solutions on the blog of the answer provided by Rahul Tiwari but I only could get that the folder .android will be in the new folder. The rest folders are at the same location after the changes.


EDIT 2: According to the blog provided by Rahul Tiwari to move the folder .gradle I change the default settings of Android Studio:

File > Other Settings... > Default Settings... > Build, Execution, Deployment > Gradle

Here I have as Service directory path: C:/Users/Administrator/AndroidStudio/.gradle

But the folder .gradle still appears on the path C:/Users/Administrator.


EDIT 3: Trying to remove the folder .AndroidStudio1.3 I changed these lines:

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

to these:

#---------------------------------------------------------------------
# Uncomment this option if you want to customize path to user installed plugins folder. Make sure you're using forward slashes.
#---------------------------------------------------------------------
idea.plugins.path=${C:/Users/Administrator/AndroidStudio/.AndroidStudio1.3/config}/plugins

#---------------------------------------------------------------------
# Uncomment this option if you want to customize path to IDE logs folder. Make sure you're using forward slashes.
#---------------------------------------------------------------------
idea.log.path=${C:/Users/Administrator/AndroidStudio/.AndroidStudio1.3/system}/log

but I also couldn't move the folder.


EDIT 4: This is the blog that I mention before (Thank you very much Rahul Tiwari). I post it here because his answer was deleted.


Thanks in advance!

question from:https://stackoverflow.com/questions/32759785/is-it-possible-to-allocate-these-folders-in-another-place

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Finally, I got the solution to move three of the folders that I put above. I think it could be interesting to put here the problems that I faced and the changes that I made to solve them.

I'm going to investigate about the last folder, .oracle_jre_usage, and I will complete this answer if I got a solution for it. Look that I complete the solution for .gradle folder.


To move .android folder

Really, following the steps of the blog that Rahul Tiwari provided, this folder could been moved. Nevertheless I'm going to put here all the process:

  • You have to move your .android folder, after closing Android Studio (if you have it running), to the folder in which you want that it will be stored, in my case, C:UsersAdministratorAndroidStudio.

  • BEWARE WITH THE SPACES IN THE NAME OF THE NEW FOLDER, IT COULD GIVE TO YOU PROBLEMS (AS ME). I mean, Android Studio, New Folder or similars.

  • If you are on Windows, you can do right-click on My Computer > Properties > Advanced System Settings > Environment Variables and create a new environment variable named ANDROID_SDK_HOME and as value you have to put the new path in which .android folder will be stored. It's the same path in which you have moved the .android folder in the step above.

  • Click "OK" button to accept your changes.

  • Re-launch Android Studio and look that the .android folder doesn't appear in the default path.


To move .AndroidStudio1.3 folder

With that folder I had some problems because I didn't noticed some details that were very important. Here the steps that I followed:

  • First of all, you have to close Android Studio before doing any change.

  • After, you have to move the folder .AndroidStudio1.3 to the path in which you want that it will be stored.

  • Next, you have to go to the folder in which Android Studio were installed and open "idea.properties" file and changed the lines where idea.config.path and idea.system.path appeared for the new path in which these folders are going to be located.

They have to be something similar to this:

idea.config.path=C:/Users/Administrator/AndroidStudio/.AndroidStudio1.3/config

idea.system.path=C:/Users/Administrator/AndroidStudio/.AndroidStudio1.3/system

Here I had three problems so please be careful:

  • Notice that the paths are with / and not with as Windows put by default.
  • DON'T CHANGE the values of idea.plugins.path and idea.log.path (My EDIT 3). Be sure that you are changing idea.config.path and idea.system.path values.
  • Uncomment the lines in which idea.config.path and idea.system.path appears. I mean, remove the # that they have at the begining of each line.
  • The last step, re-launch Android Studio.

Searching and doing some proves I also get the solution to move .gradle folder. The steps are the same as .android folder but I put here all the steps (with the values that changed) to avoid any confusion. Here it is:

To move .gradle folder

  • You have to move your .gradle folder, after closing Android Studio (if you have it running), to the folder in which you want that it will be stored, in my case, C:UsersAdministratorAndroidStudio.gradle.

  • BEWARE WITH THE SPACES IN THE NAME OF THE NEW FOLDER, IT COULD GIVE TO YOU PROBLEMS (AS ME). I mean, Android Studio, New Folder or similars.

  • If you are on Windows, you can do right-click on My Computer > Properties > Advanced System Settings > Environment Variables and create a new environment variable named GRADLE_USER_HOME and as value you have to put the new path in which .gradle folder will be stored. It's the same path in which you have moved the .gradle folder in the step above.

  • Click "OK" button to accept your changes.

  • Re-launch Android Studio and look that the .gradle folder doesn't appear in the default path.



与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...