To verify how an atomic service looks and behaves, you can run and debug it.
The procedure for running HarmonyOS atomic services on a phone is the same as that on a tablet. You can use either USB or wireless debugging for connection.
For details, see Running Your App on a Local Real Device.
Hot reload allows code changes to take effect in real time. After this feature is enabled in DevEco Studio, the debug device will automatically apply changes upon modification of page files (CSS, HXML, JS, or JSON) without additional steps. This significantly reduces recompilation and execution time while delivering a dramatic boost to development efficiency.
The following conditions should be met to use hot reload:
from the run/debug configuration menu to enter the hot reload mode.
ASCF runtime includes the view layer (Webview) and the logic layer (V8 engine), with both supporting local debugging.
To debug an ASCF project, run the following commands in the root directory of the ASCF project.
Enabling Webview debugging and V8 engine debugging:
ascf debugger start
After the command is executed successfully, open the debugging tool page in Chrome based on the log information.
Disabling Webview debugging and V8 engine debugging:
ascf debugger stop
Enabling Webview debugging:
ascf debugger start-view
Disabling Webview debugging:
ascf debugger stop-view
Enabling V8 engine debugging:
ascf debugger start-service
Disabling V8 engine debugging:
ascf debugger stop-service
Checking the current debugging status.
ascf debugger status
The web page to be debugged needs to be discovered from the local TCP ports 9222 and 9229. Therefore, ensure that Discover network targets is selected. Then, configure the network. Port 9222 corresponds to the Webview debugging window, and port 9229 corresponds to the V8 engine debugging window.
(1) Click the Configure button.
(2) Add localhost:9222 and localhost:9229 to Target discovery settings.

You can run the following command to obtain the help information about the parameters of the CLI tool debugging function:
ascf debugger start --help
Category | Option | Description |
|---|---|---|
Debug | --bundleName | Name of the ASCF package to debug. Example: ascf debugger start --bundleName com.atomicservice.1234568789 |
--deviceId | ID of the device for debugging when the PC is connected to multiple devices. Example: ascf debugger start --deviceId 123456789 You can run the hdc list targets command to query all connected target devices. |
If the preceding commands are not supported, upgrade ASCF Toolkit to 1.0.5 or later, or perform the following operations: