DEV Community

Cover image for Harmony changes the name and icon of the APP
liu yang
liu yang

Posted on

Harmony changes the name and icon of the APP

How to Change APP Name, Icon, and Configure Network Settings

When developing an APP, changing its name, icon, and configuring network access are common requirements. Follow these steps:

Changing APP Name

  1. Open Project: Launch your project and locate the module.json5 file, typically in the entry->src->main directory.
  2. Modify Name: Find the label field under the abilities node in module.json5. The value attribute of this field is your APP name. Update the value for all relevant pages. For example:

     "abilities": [
         {
             "label": {
                 "value": "NewAppName"
             },
             ...
         }
     ]
    
  3. Restart APP: Save changes and restart the APP to see the new name.

Changing APP Icon

  1. Locate Icon File: Find the layered_image.json file in your project, which defines the APP icon.
  2. Update Icon: In layered_image.json, replace or modify the icon path with your new icon's path.
  3. Check Result: Save the file, recompile, and run the APP to view the new icon.

Configuring Network Access

  1. Open module.json5: Access the module.json5 file in the entry->src->main folder.
  2. Add Network Permission: Include the following configuration to enable network access:

     "module": {
         "reqPermissions": [
             {
                 "name": "ohos.permission.INTERNET"
             }
         ]
     }
    
  3. Test Network Functionality: Save and run the APP to verify network access works properly.

These steps will help you modify APP name and icon, and configure network permissions. Feel free to leave comments for further discussion.

Top comments (0)