harmony(鸿蒙)Debugging Assistant Usage

  • 2022-08-09
  • 浏览 (654)

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.

Option Description
-e/–event Indicates the name of the common event to publish. Mandatory.
-s/–sticky Indicates that the common event to publish is sticky. Optional. By default, non-sticky events are published.
-o/–ordered Indicates that the common event to publish is ordered. Optional. By default, non-ordered events are published.
-c/–code Indicates the result code of the common event. Optional.
-d/–data Indicates the data carried in the common event. Optional.
-h/–help Indicates 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.

Option Description
-a/–all Displays information about all common events that have been sent since system startup.
-e/–event Displays information about a specific event.
-h/–help Displays 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.

Option Description
-A/–active Displays information about all active notifications.
-R/–recent Displays information about the recent notifications.
-D/–distributed Displays information about distributed notifications from other devices.
–setRecentCount Indicates the number of the cached recent notifications to be displayed. Optional.
-h/–help Displays 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

0  赞