1# anm工具
2
3Advanced Notification Manager(通知管理工具,简称anm)是实现通知打印、设置通知参数等功能的工具,为开发者提供基本的通知调试和测试能力,例如打印已发布通知详细信息、设置通知缓存个数、使能通知等。
4
5## 环境要求
6
7在使用本工具前,开发者需要先获取<!--Del-->[<!--DelEnd-->hdc工具<!--Del-->](../../device-dev/subsystems/subsys-toolchain-hdc-guide.md)<!--DelEnd-->,执行hdc shell。
8
9当前工具仅支持在eng版本中使用,在user版本中使用会出现报错error: user version cannot use setting。
10
11## anm工具命令列表
12
13| 命令 | 描述 |
14| ---- | --- |
15| help | 帮助命令,用于显示anm相关的帮助信息。 |
16| dump | 打印命令,用于打印通知相关信息。 |
17| setting | 设置命令,用于设置通知参数。 |
18
19## 帮助命令(help)
20
21  ```bash
22  # 显示anm相关的帮助信息
23  anm help
24  ```
25
26## 打印命令(dump)
27
28  ```bash
29  # 打印通知相关信息
30  anm dump [<options>]
31  ```
32
33  **打印命令参数列表**
34
35  | 参数             | 参数说明                           |
36  | ---------------- | ---------------------------------- |
37  | -A/--active      | 打印所有活跃的通知信息。             |
38  | -R/--recent      | 打印最近的通知信息。                 |
39  | -D/--distributed | 打印来自其他设备的分布式通知信息。   |
40  | -b/--bundle      | 可选参数,设置指定的Bundle名称打印。 |
41  | -u/--user-id     | 可选参数,设置指定的用户ID打印。     |
42  | -h/--help        | 帮助信息。                           |
43
44  **示例**:
45
46  ```bash
47  # 打印活跃的通知信息
48  anm dump -A
49  ```
50
51## 设置命令(setting)
52
53  ```bash
54  # 设置通知参数
55  anm setting [<options>]
56  ```
57
58  **设置命令参数列表**
59
60  | 参数                     | 参数说明                             |
61  | ------------------------ | ------------------------------------ |
62  | -c/--recent-count        | 设置保存在内存中的最近通知的最大个数。 |
63  | -e/--enable-notification | 设置通知使能开关。                     |
64  | -h/--help                | 帮助信息。                             |
65
66  **示例**:
67
68  ```bash
69  # 设置保存在内存中的最近通知的最大数为100个
70  anm setting -c 100
71  ```
72