DevEco Studio 相关设置 原创

Der_带鱼
发布于 2021-7-9 01:15
浏览
1收藏

DevEco Studio 相关设置|自学笔记

  1. devecostudio提供以下模块类型(moduleType):Entry、Feature和Har,只有Entry和Feature模块支持联机运行和调试。

  2. When compiling code, you can use the previewer to view the UI layout. The XML, Java, JS, CSS, and HML files can be previewed. You can open the previewer in any of the following ways:

(编译代码时,可以使用预览器查看UI布局。可以预览XML、Java、JS、CSS和HML文件。您可以通过以下任一方式打开预览器:)

  • On the menu bar, go to View > Tool Windows > Previewer.==(Previwer很好用,快捷键AIT+3)==
    • 需要File -> Settings -> Appearance & Behavior -> System Settings -> HarmonyOS SDK’ to agree to the license agreement and download
  • Click the Previewer tab on the right side.
  • Press Alt+3.
  1. To reinstall the app in the debugging phase while retaining the app data on the device, select the overwrite mode. Method:
    Go to Run > Edit Configurations, set the .hap package installation mode for the specified module, and select Replace existing application.

(要在调试阶段重新安装应用程序,同时在设备上保留应用程序数据,请选择覆盖模式。方法:

转到“运行”>“编辑配置”,为指定模块设置.hap包安装模式,然后选择“替换现有应用程序”。)

  1. DevEco Studio allows you to debug your app written in multiple languages. In a JS project or C/C++ project, you can select the Java+JS or Java+C debug type. Before debugging a hybrid project, set the debug type to Dual(Js + Java) or Detect Automatically. For a C/C++ project, set the debug type to Dual(Java + Native) or Detect Automatically.(devecostudio允许您调试用多种语言编写的应用程序。在JS项目或C/C++项目中,可以选择java +js或java +c调试类型。在调试混合项目之前,请将调试类型设置为Dual(Js+Java)或Detect Automatically。对于C/C++项目,将调试类型设置为双(java +本地)或自动检测。)

  2. If a device in a project has multiple modules and the modules are invoked by each other, you need to install the .hap packages of multiple modules on the device in the debug phase. In this case, select Deploy Multi Hap Package in the settings of the module to be debugged.(如果项目中的一个设备有多个模块,并且这些模块相互调用,则需要在调试阶段在该设备上安装多个模块的.hap包。在这种情况下,在要调试的模块的设置中选择deploymulti-Hap-Package。)

  3. DevEco Studio supports Java code obfuscation. You can manually set proguardEnabled in the build.gradle file of the module to true to enable the function.(java代码混淆,防反编译)

一、黑色主题界面

setting-Editor-Color Scheme-console Colors -HUAWEI Dark Theme-Apply

 DevEco Studio 相关设置-鸿蒙开发者社区

二、代码高亮

Editor > Color Scheme > Language Defaults > Semantic highlighting中,打开语义高亮开关。

 DevEco Studio 相关设置-鸿蒙开发者社区

三、整行注释

ctrl+/

四、格式化

To format code in a specified range, press Ctrl+Alt+L (Command+Option+L on macOS).
To format code in the current file, press Ctrl+Alt+Shift+L (Command+Option+L on macOS).

要格式化指定范围内的代码,请按Ctrl+Alt+L(macOS上的Command+Option+L)。

要格式化当前文件中的代码,请按Ctrl+Alt+Shift+L(在macOS上为Command+Option+L)。

五、右上角小甲壳虫

  • 使用来Debug,但要选择对应的设备,

  • 区别:previewer和Device Manager

    • previewer:View-Tool Window。快捷键:AIT+3,左下角小窗口也可以点击
    • Device Manager:Tools-Device Manager。每次使用需要登录华为平台。可以选择不同的终端设备。

©著作权归作者所有,如需转载,请注明出处,否则将追究法律责任
已于2021-7-11 12:33:50修改
4
收藏 1
回复
举报
回复
    相关推荐