From 124096d7e63f46081e11110dbce0d8395f69f19e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B4=BE=E4=BD=B3=E8=B1=AA?= <2692032597@qq.com> Date: Thu, 12 May 2022 06:02:00 +0000 Subject: [PATCH] =?UTF-8?q?add=20README=5Fen.md.=20Signed-off-by:=20?= =?UTF-8?q?=E8=B4=BE=E4=BD=B3=E8=B1=AA=20<2692032597@qq.com>?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README_en.md | 134 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 134 insertions(+) create mode 100644 README_en.md diff --git a/README_en.md b/README_en.md new file mode 100644 index 0000000..dff1524 --- /dev/null +++ b/README_en.md @@ -0,0 +1,134 @@ +# Memo source development notes +## 1. Project introduction +The Memo app is a pre-built app in OpenHarmony that allows users to edit and save text. + +## 2. Engineering structure +### directory structure +``` +/applications/standard/note +├─common +│ ├─component +│ │ └─src +│ │ └─main +│ │ ├─ets +│ │ │ └─default # Basic Interface Components +│ │ └─resources # Directory for storing resource configuration files +│ └─utils +│ └─src +│ └─main +│ ├─ets +│ │ └─default +│ │ ├─baseUtil # data processing +│ │ ├─constants # constant definition +│ │ └─model +│ │ ├─databaseModel # data format definitions +│ │ └─searchModel # Search for data format definitions +│ └─resources # Directory for storing resource configuration files +├─figures # readme of the file +└─product + ├─phone + │ └─src + │ └─main + │ ├─ets + │ │ └─MainAbility + │ │ ├─pages # Mobile home page Settings + │ │ └─res # Preset image + │ └─resources # resource file + └─tablet + └─src + └─main + ├─ets + │ └─MainAbility + │ ├─pages # Tablet home page Settings + │ └─res # Preset image + └─resources # resource file +``` + +### Overall architecture + +![](./figures/note.png) + +## 3. Signature packing +### Sign +#### Obtain the signature file +1. Generate the signature file may refer to https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/configuring-openharmony-app-signature.md + +#### Configure the signature file +Open the Project and select File → Project Structure + +![](./figures/signature_1.png) + +Go to Modules → Signing Configs and configure the corresponding signature file as follows, then click Apply and then OK. +The password is the password used to generate the signature file. If the default signature file is used, the default password 123456 is used. + +![](./figures/signature_2.png) + +After the configuration is complete, the following information is displayed in the build.gradle file + +![](./figures/signature_3.png) + +### packaging + +1. Choose Build → Build Haps(s)/APP(s) → Build Hap(s) + +![](./figures/ds_build_haps.png) + +2. Once compiled, hap packages will be generated in the 'build\outputs\hap\release' path of the project directory (if no signature is configured, only unsigned HAP packages will be generated) + + ![](./figures/ds_ohosbuild_output_dir_release.png) + +## 4. Installation and debugging + +### Install the app + +Connect the device to the computer through the debug line, the linked device is displayed on the IDE, click the Start button to install and pull up the application: + +![](./figures/install.png) + +### App debug + +#### log printing + +- Add log to the program + +```JS +console.info("note log info"); +``` + +You can view the log in DevEco Studio + +![](./figures/ds_hilog_window.png) + +#### Obtain and filter logs + +- log for + +Configure the hdC_std environment variables and export the log to a file + +![](./figures/hdc_std.png) + +``` +hdc_std shell hilog > Output file name +``` + +Example:View logs in the real environment and output all logs to the hilog.log file in the current directory + +``` +hdc_std shell hilog > hilog.log +``` + +- log filter + +Filter logs in the command line window + +``` +Hilog | grep filtering information +``` + +Example: Filter the HILOG that contains information Label + +``` +hilog | grep Label +``` + + -- Gitee