How to save and restore Android Studio user interface settings? - android-studio

Android Studio allows the user to customize certain features, such as editor settings and coding styles. On Windows boxes, the default folder for these settings appears to be C:\Users\{username}\.AndroidStudio{version}\config. I'm looking for documentation for these files so that we can decide which files should be under version control.
The goals are: 1) to have consistent UI settings for a group of developers; and 2) to have an easy way to configure a new Android Studio install.
So far, the following files look interesting:
...\config\templates\user.xml User-defined code templates
...\config\options\editor.codeinsight.xml Editor settings & code insight
...\config\options\editor.xml Editor settings
...\config\options\cachedDictionary.xml User additions to spelling dictionary.
...\config\codestyles\Default_1_.xml Code formatting

You can go file > Export settings then you get to choose exactly the settings to export and you get a single settings.jar file.
The reverse process is file > Import Settings > choose settings.jar

It seems that the user interface has changed since the last answer.
Now as of Android Studio 4.2 Bata 1 on Windows
You have to go to File -> Manage IDE Settings -> Export Setting to see the same window.
If you can't find the File > Import Settings menu, try accessing File -> Manage IDE Settings -> Export Setting.
There may be differences on the version or operating system.

On Android Studio 3 on Mac, it was configure > Export settings, resulting in a settings.zip file.

Because this is so badly implemented, in case you selected some custom folder and now the export button is disabled: you also need to manually specify a _name_.zip, the Android Studio is incapable of doing it itself, ex: x:\settings.zip
It might be obvious, but it did gave me a small headache this morning.

Related

"Unknown SDK home path" in Android Studio

I had to switch the user account on a Windows 10 PC (a very long story). Now, I am unable to open Android app projects as Android projects. I cannot even create a new Android project. I think that I have found the culprit, but do not know how to remedy it.
Start Android Studio > Configure (under Quick Start) > Project Defaults > Project Structure > SDKs under Platform Settings:
I do not know why it shows Unknown SDK home path. This is Android Studio 3.0
Could anyone offer a tip on how to deal with this?
[Update (2017-11-27)]:
The problem has been solved by:
File > Settings > plugins > Enable "Android SPK Support" and a few other relevant plugins.
Do not know why there were disabled.
I think as it is another User on Windows, Maybe the environmental variables path setting might be in User Variables rather than on a System Variables.
Because System Variables meant for all Users whereas User Variables are restricted based on User.

Android Studio. How export Live Template to file?

Android Studio 2.3.2.
I want to export Live Templates-->AndroidLog to file.
How I can do this?
Thanks.
IntelliJ IDEA (and Android Studio) stores definitions of custom live templatein automatically generated configuration files <group_name>.xml.
Depending on the operating system you are using, the <group_name>.xml files are stored at the following locations:
Windows: <your_user_home_directory>\.AndroidStudio<version_number>\config\templates
Linux: ~/.AndroidStudio<version>/config/templates
macOS: ~/Library/Preferences/AndroidStudio<version>/templates
Now you can share the templates among your teammates, send the relevant files to them with the instruction to save the files in the templates folder
Or You can sharing live templates through export/import
Open the Settings / Preferences Dialog by pressing Ctrl+Alt+S or by choosing File | Settings for Windows and Linux or IntelliJ IDEA | Preferences for macOS, and click Live Templates under Editor.
On the main menu, choose File | export Settings.
In the Export Settings dialog box that opens, select the Live Template check box and specify the name of the .jar file where the exported settings will be stored. When you click OK, IntelliJ IDEA generates a file with the specified named based on the .xml configuration files stored in the templates folder.
To share the templates among your teammates, pass the generated .jar file to them with the following instructions:
Save the received .jar file on your computer.
Choose File | Import Settings on the main menu and and specify the location of the received .jar file.
In the Select Components to Import dialog box that opens, select the Live Templates check box and click OK.
For any other information, here the official IntelliJ guide
Updated >Android 4.1
IDE configuration directory changes The locations of user
configuration directories have been changed to the following:
Windows Syntax: %APPDATA%\Google<product>
Example: C:\Users\YourUserName\AppData\Roaming\Google\AndroidStudio4.1
macOS Syntax: ~/Library/Application Support/Google/
Example: ~/Library/Application Support/Google/AndroidStudio4.1
Linux Syntax: ~/.config/Google/
Example: ~/.config/Google/AndroidStudio4.1
C:\Users\YourUserName\AppData\Roaming\Google\AndroidStudio4.1\templates
For Mac:
Android 4.1
/Users/{User Name}/Library/Application Support/Google/AndroidStudio4.1/templates

Export shortcuts from Android Studio

Is there a way to export shortcuts from Android Studio? For example, if I want to reinstall my OS and I don't want to setup all the shortcuts manually after that.
Thanks in advance.
For Android Studio before version 4.x: File -> Export settings
After version 4.x: File -> Manage IDE Settings -> Export Settings
Select key maps only if you just want to save your shortcuts.
In Android Studio Version 4, navigate to:
The File menu
Select Settings
Click on Manage IDE Settings
Select Export Settings
Please note that, this instruction may not be accurate as of the latest version of Android Studio and the layout of the menu might have changed. It is always recommended to check the official documentation for the current version of the software for accurate instructions.

Sublime TFS Settings

When working with Classic ASP, Sublime is AWESOME, but what has been stopping me so far is the fact that at work we use Visual Studio Team Services (previously Team Foundation Service) to Check-out / Check-in files we edit and work on and that goes rather well with Visual Studio 2012 that we use. But VS is so slow compared to Sublime especially when all I care about is editing text.
Today I found out that Sublime Text (I use Version 3) has a plugin for TFS! So I installed it (also installed the TFS Power Tools 2012). But now I'm confused as I can not see any visual clues to my files like I do with Visual Studio 2012, so I don't know what files are up to date, and what files need checking in ... etc.
After reading the official page of the Sublime TFS plugin. I understand that I need to set tf_path somewhere! The page though doesn't say where and in what format :( I am lost.
Where do I set the tf_path and in what format?
Any help would be great, Thank You.
Navigate to Preferences -> Package Settings -> Sublime TFS and open both Settings - Default and Settings - User (which will be an empty file). Copy the entire contents of the default settings file to the user file, then change any paths to reflect your personal setup. Save the user file (you are not allowed to modify the default file, just close it), restart Sublime for good luck, and you should be all set.
If you want your Sublime Text changes to be seen in Visual Studio Team Explorer, then you can change your Workspace to a local one.
For more information: https://www.visualstudio.com/en-us/docs/tfvc/decide-between-using-local-server-workspace
Like this, you can use Sublime Text for editing and have as much ST windows as you want. And you can do the check-in of files using the Team Explorer. This is how I work. One Visual Studio with one or more Sublime Text windows. Very light-weight, efficient and productive.

How do I truly reset every setting in Visual Studio 2012?

I am trying to reset every single setting inside Visual Studio as I have completely lost all IntelliSense. I tried the Tools -> Import/Export settings -> Reset, but that is not clearing all the settings. I know it is not since the color theme was not reset, and I still do not have IntelliSense. Short of uninstalling and deleting every trace of the program including the registry, is there another way to reset every single setting to the factory default?
Visual Studio has multiple flags to reset various settings:
/ResetUserData - (AFAICT) Removes all user settings and makes you set them again. This will get you the initial prompt for settings again, clear your recent project history, etc.
/ResetSettings - Restores the IDE's default settings, optionally resets to the specified VSSettings file.
/ResetSkipPkgs - Clears all SkipLoading tags added to VSPackages.
/ResetAddin - Removes commands and command UI associated with the specified Add-in.
The last three show up when running devenv.exe /?. The first one seems to be undocumented/unsupported/the big hammer. From here:
Disclaimer: you will lose all your environment settings and customizations if you use this switch. It is for this reason that this switch is not officially supported and Microsoft does not advertise this switch to the public (you won't see this switch if you type devenv.exe /? in the command prompt). You should only use this switch as the last resort if you are experiencing an environment problem, and make sure you back up your environment settings by exporting them before using this switch.
How to hard reset Visual Studio instance
When developing extensions sometimes you just mess up, others someone else does. If you start getting errors loading even the most mundane extensions, these are the instructions to hard reset your instance.
Close Visual Studio (if you haven’t already).
Open the registry editor (regedit.exe)
Delete the HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\{version}
Delete the HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\{version}_Config
Delete the %LOCALAPPDATA%\Microsoft\VisualStudio\{version} directory.
Enjoy your brand new Visual Studio instance.
Use {version}=10.0 for Visual Studio 2010
Use {version}=11.0 for Visual Studio 2012
Use {version}=12.0 for Visual Studio 2013
If on the other side you want to reset the experimental hive you can do the same to with the ‘{version}Exp’ ones.
Happy coding!
Source: http://www.corvalius.com/site/hacks/how-to-hard-reset-visual-studio-instance/
Click on Tools menu > Import and Export Settings > Reset all settings > Next > "No, just reset settings, overwriting all current settings" > Next > Finish.
To reset your settings
On the Tools menu, click Import and Export Settings.
On the Welcome to the Import and Export Settings Wizard page, click Reset all settings and then click Next.
If you want to delete your current settings combination, choose No, just reset settings, overwriting all current settings, and then click Next. Select the programming language(s) you want to reset the setting for.
Click Finish.
The Reset Complete page alerts you to any problems encountered during the reset.
Executing the command: Devenv.exe /ResetSettings like :
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE>devenv.exe /ResetSettings , resolved my issue :D
For more: https://msdn.microsoft.com/en-us/library/ms241273.aspx
Just repair Visual Studio itself from the control panel and that should do the trick!
1) Run Visual Studio Installer
2) Click More on your Installed version and select Repair
3) Restart
Worked on Visual Studio 2017 Community

Resources