Pgyer document center

鸿蒙 HarmonyOS 如何进行 App 内测分发

With the rapid development of HarmonyOS ecosystem, more and more developers start to build pure-blooded HarmonyOS Native apps. In order to support developers to complete the internal testing process efficiently, Dandelion's internal testing and distribution platform now completely supports uploading, verifying and distributing HarmonyOS Apps (.hap files), which can help testers to download and install them conveniently.

I. Introduction to HarmonyOS App

HarmonyOS is a new-generation multi-device operating system launched by Huawei, supporting various terminals such as cell phones, tablets, and wearable devices. Native HarmonyOS apps are built by developers using the ArkTS programming language, packaged in .hap format, and signed and verified using the certificate mechanism provided by HarmonyOS.

  • .hap is the installable application package of Hongmeng system (similar to .apk of Android);
  • Each .hap must be signed before it can be installed on a HarmonyOS device;
  • The certificate used for signing is in .p12 format and must come from a Huawei developer account.

The signature is divided into two parts:

  1. ** Signing the hap ontology** (done locally by the user, Dandelion is not involved);
  2. Sign the manifest.json5 file (Dandelion platform completes this step);

2. The operation flow of distributing Hongmeng App on Dandelion Platform

First step: upload the signed .hap file.

Users need to sign the .hap file locally with the developer certificate. The version of the platform uploaded to Dandelion must be the signed version.

Please make sure before uploading:

  • The .hap file has been signed with a signing tool, such as Huawei's official tool DevEco-Studio;
  • The .p12 certificate used for signing .hap is identical to the .p12 file that will be uploaded to the Dandelion platform exactly.

! Ready to upload

Step 2: Fill in App Information (optional)

To facilitate testers to identify the app, you can optionally fill in the following information:

  • App name, version number (Dandelion will automatically parse and display)
  • Update log
  • Screenshots of the app
  • Description of internal testing

This information will be displayed in the distribution page to enhance professionalism and readability.

! Fill in App Info

Step 3: Upload .p12 file and set its password (for manifest.json5 signature)

During the Hongmeng internal testing process, the platform needs to sign the manifest.json5 file to generate valid installation metadata. You need to provide the .p12 certificate and its password which is homologous to .hap:

  • The .p12 certificate is from Huawei Developer Platform or DevEco Studio;
  • This certificate must match the certificate used for signing the .hap file itself that you uploaded in step 1, or the installation will fail;
  • Pope will not sign the .hap itself, it is only used for manifest.json5 file signing.

! upload p12 certificate

Why do I need .p12?

This is one of the authentication mechanisms specified by Huawei. The HarmonyOS device on the user side verifies the manifest.json5 file signature to ensure the source is trusted. For details, see: Huawei official documentation

Translated with DeepL.com (free version)