Publish for the Huawei HarmonyOS

    • Enter to register for a HUAWEI ID.

    • After logging in, select and Add HarmonyOS App, select the Platform as HarmonyOS.

    • Download and install . After the installation is complete Configure Development Environment, download the HarmonyOS SDK, please check Java and Native for the SDK packages in the SDK Platforms page.

      dev setting

      Remember the directory indicated by HarmonyOS SDK Location shown at the top of the window, fill in the path of this SDK in the Preferences panel of Cocos Creator later.

    1. Use Cocos Creator to open the project, click Cocos Creator -> Preferences -> External Programs in the upper menu bar, configure HarmonyOS NDK and HarmonyOS SDK path:

    2. Open the project directory after the build is complete, notice that the ohos folder is generated under the native\engine directory, which contains the HarmonyOS project generated by the build.

      package

    1. Open HUAWEI DevEco Studio, click Open Project and select the HarmonyOS project (ohos folder) generated after the build in the previous step.

    2. Prepare the signature file. For the method of obtaining the signature file, please refer to the contents of the Signature File section below.

    3. Configure the signature file. Click File -> Project Structure in the DevEco Studio menu bar, then select Modules -> entry -> Signing Configs and configure the signature information. For details, please refer to the Configure Signature Information documentation.

      sign configs

      Then proceed to configure the signature information in Project -> Signing Configs.

      After setting and saving, the configured signature information can be viewed in the project directory in the native\engine\ohos\entry\build.gradle file in the project directory.

      Depending on the build type (Debug/Release) and whether the generated .hap contains signature information, the developer can configure in combination as needed, please refer to the documentation for details.

    4. Then click on the Build -> Build Hap(s)/APP(s) -> Build Hap(s) in the menu bar to execute the compilation process and generate the file.

      build hap

      After compiling, the .hap file with signature information is generated in the native\engine\ohos\build\outputs\hap directory of the project directory.

      All .hap files with/without signature information are generated in the native\engine\ohos\entry\build\outputs\hap directory of the project directory.

      output

    5. If need to upload and publish HarmonyOS apps to Huawei AppGallery Connect, please refer to the official Release HarmonyOS Application Guide documentation for the specific process.

    HarmonyOS applications use digital certificates (.cer files) and HarmonyAppProvision files (.p7b files) to ensure the integrity of the application. First, use DevEco Studio to generate a key and certificate request file, and then use the certificate request file to apply for a digital certificate and profile file for publishing/debugging in AppGallery Connect.

    Generate key and certificate request file

    In DevEco Studio, click Build -> Generate Key and CSR in the upper menu bar to generate a key ( file), and then generate a certificate request file (.csr). For details, please refer to the documentation.

    Generate and download a digital certificate (.cer file)

    • Visit the , select Users and permissions -> Certificate management, click the New certificate button in the upper right corner.

      cer profile

    • Enter the required certificate information in the New certificate dialog box that is displayed. Certificate type Choose Release certificate/Debug certificate as required. The certificate request file is the .csr file generated in DevEco Studio in the previous step.

      • Certificate name: Enter up to 100 characters.
      • Certificate type: Select Release certificate/Debug certificate as required.
      • CSR certificate request file: Select the .csr file generated in DevEco Studio in the previous step.

    For more information, please refer to the Apply for Digital Certificate documentation.

    Generate and download HarmonyAppProvision Profile file (.p7b file)

    • Enter AppGallery Connect website, select My Project, select the HarmonyOS project and application created before.

    • Click the HarmonyOS app services -> HAP Provision Profile management item on the left, and then click the Add button at the top right of the page to create a .p7b file.

      provision profile

    • Enter the required information in the HarmonyAppProvision information dialog box that is displayed.

      • HarmonyAppProvision file: Enter the file name, which contains up to 100 characters.
      • Type: Select Release or certificate as required.
      • Certificate: Select the .cer file generated in the previous step.
      • Device: Please refer to the documentation for configuration. It is not necessary to configure this item when the Type is set to Release.
    • After setting, click Submit to download the generated .p7b file to the local.
    • WebView does not support touch events, touch is not responsive.
    • VideoPlayer does not support dragging video when playing remote video.
    • EditBox is not zoomed out when full screen, and does not re-layout after keyboard retraction.
    • Gravity/acceleration sensor delay around 500ms, poor followability.