• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..17-Mar-2025-

cjson/H17-Mar-2025-1410

entry/H17-Mar-2025-566415

jerryScript/H17-Mar-2025-281272

jsfwk/H17-Mar-2025-2,3861,574

README_zh.mdH A D17-Mar-20256.3 KiB14388

simulator.proH A D17-Mar-20251.1 KiB2521

README_zh.md

1# 模拟器调试使用说明
2
3## 1、环境安装说明
4
5### 1、Qt Creator安装
6   本工程基于QT Creator搭建,开发者使用前需要下载和安装QT Creator。
7
81. **程序下载**
9
10   地址:https://www.qt.io/offline-installers ,安装程序较大,建议下载离线稳定版本。
11
122. **程序安装**
13
14   双击下载的Qt安装程序,按引导界面完成安装即可。
15
16  ```
17  注意事项:
18  1. 注册安装界面
19     可选择注册账号进行安装,或者断网安装跳过注册界面。
20  2. 选择组件界面。
21     需勾选Qt x.x.x展开栏(这栏是为qt自动配置构建套件,如果漏选,开发者可后期在Qt控件中自行手动配置)和Developer and Designer Tools展开栏(这栏是编译器组件下载)都要勾选minGW组件(基于当前电脑操作系统选择32-bit还是64-bit)。
22  ```
23
24![安装组件选择](../../../../figures/MinGW-select.png)
25
26### 2、Git for windows安装
27
28​		为能在windows环境下使用git命令,开发者需安装Git for windows。
29
301. **程序下载**
31
32   地址:[Git for Windows](https://gitforwindows.org/)
33
342. **程序安装**
35
36   双击下载的安装程序,按引导界面完成安装即可。
37
38## 2、打开工程
39
40### 场景一:JS应用打开方式:
411. **源码下载**
42   建议在Linux下使用 repo 批量下载所涉及到的代码仓到windows盘符下,下载后在windows下打开工程。
43
44   ```bash
45   // 初始化 repo
46   repo init -u https://gitee.com/openharmony/manifest.git -b master --no-repo-verify
47   // sync 所有相关仓
48   repo sync graphic_surface_lite arkui_ui_lite graphic_graphic_utils_lite window_window_manager_lite third_party_bounds_checking_function third_party_cJSON third_party_zlib third_party_freetype third_party_harfbuzz third_party_icu third_party_libjpeg-turbo third_party_libpng third_party_qrcodegen third_party_zlib commonlibrary_utils_lite ability_ability_lite third_party_jerryscript arkui_ace_engine_lite global_resource_management_lite
49   ```
50
512. **打开QT Creator**
52
533. **点击菜单:文件—>打开文件或项目**
54
55   - 弹出的文件选择框中选择工程项目
56
57   - 参考源码路径(请下载到windows本地,不要使用"\\\wsl$"路径映射):
58
59     [源码工程目录]\foundation\arkui\arkui_ace_engine_lite\frameworks\tools\qt\simulator\simulator.pro60
61     注意:第一次打开项目时,需要在Configure Project界面,kits列表中勾选minGW(仅勾选minGW)。
62
63   - 点击configure project按钮加载工程。
64
654. **编译**
66
67    依次点击:**构建—>编译项目**,或者直接在项目树中右键,在右键菜单中选择**重新构建**即可。
68
695. **调试**
70
71    编译完成后,点击调试按钮即可运行调试。
72
736. **设置JS bundle路径**
74
75    项目第一次启动时,由于未配置JS Bundle路径,无法正常显示应用,需要开发者手动配置路径,配置后再次启动时会根据已配置信息显示应用。
76
77    配置方法:点击界面下方JS Bundle目录选择按钮,选择JS Bundle所在目录,然后点击Start按钮即可启动。
78
79    备注:JS Bundle可通过下载DevEco Studio创建应用后编译生成(编译生成的JS Bundle路径:项目所在目录\entry\build\intermediates\res\debug\lite\assets\js\default),部分应用示例源码可从目录arkui_ace_engine_lite\frameworks\examples
80    获取。JS应用开发可参考文档  https://docs.openharmony.cn/pages/v3.1/zh-cn/device-dev/guide/device-camera-visual-overview.md81
826. **备注**
83
84  1、当前模拟器工程暂时只支持UI调试,不支持JS API,如果项目中使用了部分JS API,可能会导致应用无法正常显示。对JS API的支持会陆续增加完善,敬请期待。
85
86### 场景二:C++ UI应用打开方式:
87
881. **源码下载**
89
90   如果使用Windows调试,建议不要使用"\\wsl$"路径映射,下载到本地硬盘下。
91
92   下面为拉取UI模拟器最小代码仓的git命令。
93
94   ```
95   git clone https://gitee.com/openharmony/arkui_ui_lite.git                        -b   master  foundation/arkui/ui_lite
96   git clone https://gitee.com/openharmony/graphic_graphic_utils_lite.git           -b   master  foundation/graphic/graphic_utils_lite
97   git clone https://gitee.com/openharmony/third_party_zlib.git                     -b   master  third_party/zlib
98   git clone https://gitee.com/openharmony/third_party_qrcodegen.git                -b   master  third_party/qrcodegen
99   git clone https://gitee.com/openharmony/third_party_libpng.git                   -b   master  third_party/libpng
100   git clone https://gitee.com/openharmony/third_party_libjpeg.git                  -b   master  third_party/libjpeg
101   git clone https://gitee.com/openharmony/third_party_icu.git                      -b   master  third_party/icu
102   git clone https://gitee.com/openharmony/third_party_harfbuzz.git                 -b   master  third_party/harfbuzz
103   git clone https://gitee.com/openharmony/third_party_freetype.git                 -b   master  third_party/freetype
104   git clone https://gitee.com/openharmony/third_party_bounds_checking_function.git -b   master  third_party/bounds_checking_function
105   git clone https://gitee.com/openharmony/third_party_cJSON.git                    -b   master  third_party/cJSON
106   ```
107
108   1. 新建一个源码工程目录。
109   2. 在新建目录按鼠标右键打开Git Bash Here,复制粘贴上面命令到终端回车等待下载。或者在当前目录新建一个clone.bat文件,将上面命令复制保存,双击运行clone.bat,等待下载完成。
110
1112. **打开QT Creator**
112
1133. **点击菜单:文件—>打开文件或项目**
114
115   - 弹出的文件选择框中选择工程项目
116
117   - 参考源码路径:
118
119     [源码工程目录]\foundation\arkui\ui_lite\tools\qt\simulator\simulator.pro
120
121     注意:第一次打开项目时,需要在Configure Project界面,kits列表中勾选minGW(仅勾选minGW)。
122
123   - 点击configure project按钮加载工程。
124
1254. **UI Test应用运行入口**
126
127   - 展开项目树
128
129   ```
130   simulator
131     |-UITest
132       |-Sources
133         |-main.cpp
134   ```
135
1365. **编译**
137
138    依次点击:**构建—>编译项目**,或者直接在项目树中右键,在右键菜单中选择**重新构建**即可。
139
1406. **调试**
141
142    编译完成后,点击调试按钮即可运行调试。
143