1# Debug
2
3### 介绍
4
5本示例通过使用[@ohos.hidebug](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis-performance-analysis-kit/js-apis-hidebug.md) 接口来获取当前应用内存使用情况。
6
7### 效果预览
8
9|主页|Debug数据|
10|--------------------------------|--------------------------------|
11|![](screenshots/device/index.jpeg)|![](screenshots/device/data.jpeg)|
12
13使用说明
14
151.点击界面右上方Debug图标,弹出Debug信息界面,显示当前应用内存使用情况;
16
172.再次点击右上方Debug图标,Debug信息界面消失。
18
19### 工程目录
20
21```
22entry/src/main/ets/
23|---Application
24|---component
25|   |---DebugInfo.ets                  // Debug信息页面
26|---data
27|   |---Logger.ts                      // 日志工具
28|---MainAbility
29|---pages
30|   |---Index.ets                      // 首页
31```
32### 具体实现
33
34* 本实例获取Debug信息的功能结主要封装在Index,源码参考:[Index.ets](entry/src/main/ets/pages/Index.ets) 。
35    * 获取Debug信息:在Index页面中通过点击事件调用hidebug.getPss()、hidebug.getSharedDirty()、hidebug.getPrivateDirty()等方法能够获取应用进程实际使用的物理内存大小、进程的共享脏内存大小、进程的私有脏内存大小。
36
37### 相关权限
38
39不涉及。
40
41### 依赖
42
43不涉及。
44
45### 约束与限制
46
471.本示例仅支持标准系统上运行。
48
492.本示例已适配API version 11版本SDK,版本号:4.1.3.3。
50
513.本示例需要使用DevEco Studio 3.1 Beta2 (Build Version: 3.1.0.400 构建 2023年4月7日)及以上版本才可编译运行。
52
53### 下载
54
55如需单独下载本工程,执行如下命令:
56```
57git init
58git config core.sparsecheckout true
59echo code/BasicFeature/DFX/Debug/ > .git/info/sparse-checkout
60git remote add origin https://gitee.com/openharmony/applications_app_samples.git
61git pull origin master
62
63```
64