Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio. How export Live Template to file?

Android Studio 2.3.2. I want to export Live Templates-->AndroidLog to file. enter image description here

How I can do this? Thanks.

like image 463
Alexei Avatar asked May 25 '17 09:05

Alexei


2 Answers

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

like image 186
Adarsh Sahu Avatar answered Sep 24 '22 15:09

Adarsh Sahu


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

  1. 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.
  2. On the main menu, choose File | export Settings.
  3. 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.
  4. To share the templates among your teammates, pass the generated .jar file to them with the following instructions:
  5. Save the received .jar file on your computer.
  6. Choose File | Import Settings on the main menu and and specify the location of the received .jar file.
  7. 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

like image 40
Nicola De Fiorenze Avatar answered Sep 21 '22 15:09

Nicola De Fiorenze