harmony(鸿蒙)Debugging Assistant Usage

2022-08-09 浏览 (804)

Debugging Assistant Usage

The common event and notification module provides debugging tools to facilitate your application development. With these tools, you can view common event and notification information, publish common events, and more. These tools have been integrated with the system. You can run related commands directly in the shell.

cem Debugging Assistant

publish

  • Function

    Publishes a common event.

  • Usage

    cem publish [<options>]

    The table below describes the available options.

OptionDescription
-e/--eventIndicates the name of the common event to publish. Mandatory.
-s/--stickyIndicates that the common event to publish is sticky. Optional. By default, non-sticky events are published.
-o/--orderedIndicates that the common event to publish is ordered. Optional. By default, non-ordered events are published.
-c/--codeIndicates the result code of the common event. Optional.
-d/--dataIndicates the data carried in the common event. Optional.
-h/--helpIndicates the help Information
  • Example

    cem publish --event "testevent"

    Publish a common event named testevent.

    cem-publish-event

    cem publish -e "testevent" -s -o -c 100 -d "this is data"

    Publish a sticky, ordered common event named testevent. The result code of the event is 100 and the data carried is this is data.

    cem-publish-all

dump

  • Function

    Displays information about common events.

  • Usage

    cem dump [<options>]

    The table below describes the available options.

OptionDescription
-a/--allDisplays information about all common events that have been sent since system startup.
-e/--eventDisplays information about a specific event.
-h/--helpDisplays the help information.
  • Example

cem dump -e "testevent"

​ Display information about the common event testevent.

cem-dump-e

help

  • Function

    Displays the help information.

  • Usage

    cem help

  • Example

    cem-help

anm Debugging Assistant

dump

  • Function

    Displays information about notifications.

  • Usage

    anm dump [<options>]

    The table below describes the available options.

OptionDescription
-A/--activeDisplays information about all active notifications.
-R/--recentDisplays information about the recent notifications.
-D/--distributedDisplays information about distributed notifications from other devices.
--setRecentCountIndicates the number of the cached recent notifications to be displayed. Optional.
-h/--helpDisplays the help information.
  • Example

    anm dump -A

    Display information about all active notifications.

    anm-dump-A

    anm dump --setRecentCount 10

    Set the number of the cached recent notifications to be displayed to 10.

help

  • Function

    Displays the help information.

  • Usage

    anm help

  • Example

anm-help

你可能感兴趣的鸿蒙文章

harmony(鸿蒙)Common Event and Notification

harmony(鸿蒙)Agent-Powered Scheduled Reminder Development

harmony(鸿蒙)Agent-Powered Scheduled Reminder Overview

harmony(鸿蒙)Common Event Development

harmony(鸿蒙)Common Event and Notification Overview

harmony(鸿蒙)Notification Development

  • 所属分类: 后端技术
  • 本文标签: 鸿蒙 软件
  • 版权声明: 本文链接 https://seaxiang.com/blog/bfcb5407e26e469bae8bf9e0228e4fb4