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

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

问题描述

Android Studio 2.3.2. 我想将实时模板-> AndroidLog 导出到文件中.

Android Studio 2.3.2. I want to export Live Templates-->AndroidLog to file.

我该怎么做? 谢谢.

推荐答案

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

IntelliJ IDEA (and Android Studio) stores definitions of custom live templatein automatically generated configuration files <group_name>.xml.

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

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

For any other information, here the official IntelliJ guide

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

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