安卓工作室.如何将实时模板导出到文件? [英] Android Studio. How export Live Template to file?

查看:29
本文介绍了安卓工作室.如何将实时模板导出到文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Android Studio 2.3.2.我想将 Live Templates-->AndroidLog 导出到文件.

我该怎么做?谢谢.

解决方案

IntelliJ IDEA(和 Android Studio)将自定义实时模板的定义存储在自动生成的配置文件 .xml 中.>

根据您使用的操作系统,.xml 文件存储在以下位置:

  • Windows:\.AndroidStudio\config\templates
  • Linux:~/.AndroidStudio/config/templates
  • macOS:~/Library/Preferences/AndroidStudio/templates

现在您可以在队友之间共享模板,将相关文件发送给他们,并附上将文件保存在模板文件夹中的说明

您可以通过导出/导入共享实时模板

  1. 按 Ctrl+Alt+S 或选择文件"| 打开设置/首选项"对话框.Windows 和 Linux 或 IntelliJ IDEA 的设置 |macOS 的首选项,然后单击编辑器下的实时模板.
  2. 在主菜单上,选择文件 |导出设置.
  3. 在打开的导出设置"对话框中,选中实时模板"复选框并指定将存储导出设置的 .jar 文件的名称.单击确定"后,IntelliJ IDEA 会根据模板文件夹中存储的 .xml 配置文件生成具有指定名称的文件.
  4. 要在您的团队成员之间共享模板,请按照以下说明将生成的 .jar 文件传递​​给他们:
  5. 将收到的 .jar 文件保存在您的计算机上.
  6. 选择文件 |在主菜单上导入设置并指定接收到的 .jar 文件的位置.
  7. 在打开的选择要导入的组件"对话框中,选中实时模板"复选框并单击确定".

有关任何其他信息,此处官方IntelliJ 指南

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

  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

这篇关于安卓工作室.如何将实时模板导出到文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆