To support developers who use Visual Studio Code (VS Code), the ASCF team has developed and maintains the VS Code plugin, ASCF Assistant. It provides one-click project creation, quick conversion, and debugging features to aid in atomic service development.
Before using the VS Code plugin, ensure that DevEco Studio is installed and the necessary environment variables are configured.

In VS Code, click Extensions. Search for "ASCF Assistant" in the Marketplace and click Install. A successful installation is indicated by the appearance of the atomic service icon
in the sidebar.

Click the atomic service icon
to start development with ASCF Assistant.
ASCF Assistant 1.0.7 introduces the Developer Home feature. You can click the atomic service icon
to access the Developer Home page, facilitating your atomic service development. For details, please refer to Developer Home.
Click the project creation button.

On the displayed page, configure the project information as prompted to create a project.

Click Industry template and select an industry template for hands-on development. Currently, templates for education, e-commerce, news, reading, and takeaway are available.
Complete the project configuration and click Finish.

| Project Information | Description |
|---|---|
| App ID | App ID. You can find the app ID of your atomic service by signing in to HUAWEI Developers and choosing My Projects > Settings > Regular > App > APP ID. |
| Project Name | Name of the created project. |
| Save Location | Path for saving the created project. Ensure that the selected folder is empty. |
| Device Types | Device types on which the atomic service can run. Currently, the atomic service can run on phones and tablets. |
You can query the app ID in AppGallery Connect. However, the VS Code plugin does not support signature generation for atomic services. You need to configure the signature corresponding to the app ID in the signingConfigs field of the build-profile.json5 file in the root directory of the new project. You can use the signature automatically generated by DevEco Studio or an existing signature.
Example:

Open the new ASCF project and delete the ascf/ascf_src directory.
Click the conversion button and select a mini program project (such as WeChat or Alipay mini program).

After a successful conversion, you can view the conversion information by clicking the Open Report button in the bottom-right corner.

During development, ASCF Assistant supports the following features to help you develop atomic services more conveniently and efficiently:
One-click creation of pages and components
By right-clicking in a directory file and selecting New ASCF Page, you can quickly generate the files required for a page.


Code highlighting and automatic completion of component properties
One-click generation of atomic service icons

For details, please refer to Atomic Service Icon Generation Tool.
You can click the run button at the bottom of VS Code to compile the atomic service. If a device is connected, the atomic service will automatically run on the selected device.

After the build starts, the ASCF Assistant run log panel will open automatically. You can click the gear button to view logs filtered by log level.

ASCF Assistant 1.0.8 and later versions support screen mirroring on devices running HarmonyOS 4 or earlier. Screen mirroring is automatically enabled upon atomic service startup.
In addition to the run buttons, ASCF Assistant also provides other commonly used function buttons.

You can click the device selection button (marked by ① in the figure in Function Buttons; the button shows No Devices when no device is selected) to select the device connected to the computer. If the connected device changes, you need to reselect it. Debugging and running are supported on devices running HarmonyOS 4 or earlier and devices running HarmonyOS 5.0 or later. The device name and OS version are displayed in the device selection list. Select a suitable device for debugging and running.

After the connected device is changed, you need to click the device selection button to change the device before running the atomic service.
You can click the build environment button (marked as ② in the figure in Function Buttons) to switch the build environment.
Both debug and release build environments are supported:
In the debug environment, the debug build mode is used. Subpackages are disabled by default; source maps are generated; and debugging is supported.
In the release environment, the release build mode is used to compress, obfuscate, and package code.

If a device running HarmonyOS 4 or earlier is selected, the following build artifacts are generated:
When the build environment is set to debug and package splitting is disabled, the artifact is entry\build\default\outputs\default\entry-default-signed.hap.
When the build environment is set to debug and package splitting is enabled, add the ascf.config.json file to the ascf\ascf_src directory and set the file content to { "disableSubpackages": false }. The artifact is ascf\build\name-default.zip.
When the build environment is set to release, the artifact is build\outputs\default\name-default-signed.app.
On devices running HarmonyOS 4 or earlier, you need to download and install Quick App Loader to debug and run the atomic service. You can run the preceding artifact on Quick App Loader using the adb command.
Through a server: Start the server in the preceding artifact directory, replace ${appid} with the app ID of your atomic service, and replace ${app} with the artifact name.
http-server -p 3000
adb reverse tcp:3000 tcp:3000
adb shell am start -a android.intent.action.VIEW -d hap://app/com.atomicservice.${appid} -p com.huawei.fastapp.dev --es pkgUrl http://127.0.0.1:3000/${app} Through local package pushing: Replace path/to/app with the path of the preceding artifact, ${appid} with the app ID of your atomic service, and ${app} with the artifact name.
adb push path/to/app /data/local/tmp/
adb shell am start -a android.intent.action.VIEW -d hap://app/com.atomicservice.${appid} -p com.huawei.fastapp.dev --es pkgUrl file:///data/local/tmp/${app} You can click the hot reload button (marked by ③ in the figure in Function Buttons) to enable or disable hot reload. Clicking the run button initiates hot reload for compilation.

Currently, hot reload is not supported on devices running HarmonyOS 4 or earlier.
You can click Start Hilog (marked as ④ in the figure in Function Buttons) to view logs. You can filter log information by log level and search keyword. Features such as log export, word wrap, and clearing window logs are also available. After connecting a device to the computer, you can click
to enable HiLog.
After the device is connected to the computer and the ASCF atomic service is started, you can enable HiLog to view logs of the corresponding level.
The buttons in the HiLog window are described as follows:
: starts the log process.
: pauses log output.
: resumes log output.
: saves logs to a file.
: enables word wrap for logs. Otherwise, logs are displayed as raw lines.
: exits the log process.
For devices running HarmonyOS 5.0 or later, the system queries the running atomic service process based on the bundle name of the project by default and displays the logs of the process. If no matching process is found, Unlimited is automatically selected. To view the startup logs, you need to enable log collection in the Unlimited mode and then run the atomic service.
For devices running HarmonyOS 4 or earlier, the system queries the running atomic service process by default and displays the logs of the process. If no matching process is found, Unlimited is automatically selected. To view the startup logs, you need to enable log collection in the Unlimited mode and then run the compatible atomic service.
You can filter and view logs by selecting a log level from the drop-down list.
You can view logs by domain. The default value is 0x006F, indicating service logs output by atomic services. All logs are output when the value is empty. Multiple values can be entered. Use commas (,) to separate the values (for example, 0x006F,0x8BF2).
The default maximum number of cached logs in the memory is 5,000. A larger value can be configured as needed.
You can click
to enable or disable debugging. Clicking the debug button starts debugging.

For details, please refer to Debugging with ASCF Assistant.
The atomic service icon generation tool consists of two parts: the tool integrated in ASCF Assistant (on the IDE side) and the SDK.
IDE tool
Similar to atomic service icon generation in DevEco Studio, you can also generate atomic service icons directly when developing with ASCF Assistant.
The atomic service icon generation tool is supported in ASCF Assistant 1.0.5 and later versions.
After installing ASCF Assistant and opening an ASCF project, right-click any folder in the project and choose Image Asset from the shortcut menu to open the atomic service icon generation tool, as shown in the following figure.

Select an image by following the instructions on the opened page. For details about the image format, please refer to the atomic service icon design specifications.

Select the color of the outer circle line and click the corresponding button to generate the atomic service icon.
SDK
To meet service providers' needs, ASCF provides an SDK version to help them integrate the atomic service icon generation capability.
Install the SDK in the frontend project.
npm install @atomicservice/as-icon-generator
import { AsIconGenerator } from '@atomicservice/as-icon-generator';
// Note: srcImg can be either a URL or an image object.
const img = new Image();
img.src = 'src/assets/test.jpg';
const asIconGenerator = new AsIconGenerator({ srcImg: img });
// Obtain the color.
const colors = await asIconGenerator.getColors();
// Note: All available colors need to be displayed on the interface so that users can select a suitable color.
asIconGenerator.setColor(colors[0]);
// Generate an image. agc: true indicates that the icon used in AppGallery Connect is also generated.
const result = await asIconGenerator.generate({ agc: true });
// result.outputImage
// result.agcImage
If a cross-origin error occurs during the request for the selected image, the server hosting the source image must be configured to support cross-origin access.
If no ASCF project is open, click the atomic service icon. Then you can create or import an ASCF project, or convert a mini program project into an ASCF project.
Basic information of an atomic service
The basic information module consists of the atomic service icon, AppName, AppID, signature configuration, and runtime version.
The icon in the upper left corner of the Developer Home page is the icon of the current atomic service project. You can click the icon to open the atomic service icon generation tool. Clicking anywhere outside the atomic service icon generation tool page or clicking the close button at the bottom of the tool page exits the tool.
AppName indicates the name of the current atomic service project. You can click Edit to change the atomic service name in the dialog that is displayed, and then click Save.
AppID indicates the app ID of the current atomic service project.
Atomic service signature configuration
It indicates whether a debug or release signature has been configured for the current atomic service project.
It indicates whether a signature has been configured based on the signingConfigs field in the build-profile.json5 file in the root directory of the atomic service project. Signature configurations defined in developer-customized targets are not supported.
Click Reference to open the signature configuration reference document. Click Configure to open the build-profile.json5 file. After you modify the signingConfigs field and save the file, the signature configuration status on the Developer Home page will be automatically updated.
It displays the runtime version of the current project.
Shortcut operations
Click Permission Configuration to open the permission configuration dialog.
The application reason and invoking time in the permission modification and application dialog are not mandatory. For details, please refer to Declaring Permissions.
Select the required permissions in the list of permissions that have not been obtained, and click Apply. In the dialog that is displayed, enter the application reason and invoking time, and click Save to add the permission application configuration.
Select a permission from the list of obtained permissions and click Modify. In the dialog that is displayed, modify the application reason and invoking time, and click Save to modify the permission application configuration.
After selecting a permission, click Delete to delete unnecessary permission configuration information.
Before using the package size analysis feature, ensure that the project can be compiled properly.
Click the package size analysis button to start analyzing the package of the current project from multiple dimensions.
Click Disable service to exit the package size analysis feature.
Basic configuration
Atomic service domain name management
Clicking Edit Domain Name opens Configuring Server Domain Names on HUAWEI Developers in the browser, where you can view the configuration guide.
Clicking the configuration button opens Enabling Huawei Open Capabilities for Your HarmonyOS App on HUAWEI Developers in the browser, where you can view the configuration guide.
Resource center
Click Developer Documentation, API Documentation, Service Provider Development Documentation, Harmony Assistant, or ASCF Community to access the corresponding guide on HUAWEI Developers in a browser.
You can run ASCF commands by entering them in the search box, as shown in the following figure.

| ID | Title | Description |
|---|---|---|
| ascf-plugin.addProject | Create ASCF Project | Creates an ASCF project. |
| ascf-plugin.ascfBuild | Build ASCF | Builds the ASCF project. |
| ascf-plugin.ascfBuild.clean | Clean | Cleans the build output. |
| ascf-plugin.ascfBuild.install | Install dependencies | Installs dependencies. |
| ascf-plugin.ascfBuild.stop | Stop build ASCF | Stops building. |
| ascf-plugin.ascfBuild.sync | Sync | Synchronizes project configurations. |
| ascf-plugin.ascfBuildAndDebug | Build and debug ASCF | Builds and debugs the ASCF project. |
| ascf-plugin.ascfBuildAndDebug.stop | Stop build ASCF | Stops building. |
| ascf-plugin.ascfBuildApp | Build ASCF App | Builds the ASCF app. |
| ascf-plugin.ascfDebugger.start | Start Debugger | Starts the debugger. |
| ascf-plugin.ascfDebugger.stop | Stop Debugger | Stops the debugger. |
| ascf-plugin.chooseDevice | Choose device | Selects a device. |
| ascf-plugin.createAscfComponent | New ASCF Component | Creates an ASCF component. |
| ascf-plugin.createAscfPage | New ASCF Page | Creates an ASCF page. |
| ascf-plugin.createServiceWidget | New ASCF Service Widget | Creates an ASCF service widget. |
| ascf-plugin.deleteRecentProject | Remove recent ASCF project | Removes the latest ASCF project. |
| ascf-plugin.hilog | Hilog | Starts HiLog. |
| ascf-plugin.hilog.stop | Stop Hilog | Stops HiLog. |
| ascf-plugin.importProject | Import miniprogram | Converts mini program resources. |
| ascf-plugin.initTypings | Init typings | Initializes typings. |
| ascf-plugin.openProject | Open ASCF project | Imports an ASCF project. |
| ascf-plugin.openSelectProject | Open ASCF project | Imports an ASCF project. |
| ascf-plugin.showConvertReport | Show convert report | Displays the conversion report. |
| ascf-plugin.startAbility | Start ability | Starts an ability. |
| ascf-plugin.startScreenCast | Start ScreenCast | Starts screen mirroring. |
The ASCF Assistant plugin supports run configuration settings. Click the gear button
in the bottom-left corner of VS Code to open the Manage menu, select Settings, and enter ascf-plugin in the search box to configure the plugin behavior.
| ID | Description | Default Value |
|---|---|---|
| ascf-plugin.devecoSdkHome | DEVECO SDK path. | "" |
| ascf-plugin.forceNewWindow | Indicates whether to open a new project in a new window. | false |
| ascf-plugin.hilogDomains | HiLog domain ID. | "0x006F" |
The following GIF image shows how to configure the plugin.
