Introduction
This chapter explains how to add a release certificate, create a release Profile, and sign your application correctly.
Certificate Preparation
First, ensure that a release certificate already exists. If it does, you can skip this step. Each developer account has a single release certificate, which should be used for all apps released under that account.
Click the link below to open the webpage. Log in with an administrator account and click "Certificates, APP IDs, and Profiles":
https://developer.huawei.com/consumer/en/service/josp/agc/index.html#/If a valid Release Certificate already exists, you can skip this section.
Key and CSR Generation
In DevEco, go to the menu bar: Build -> Generate Key and CSR
Assuming you have never created a certificate before, create a new folder "~/profiles_backup", and select "New".
-
In the pop-up window:
-
Key Store file: Select where to save the Key. Here, choose the "~/profiles_backup" folder and name the file
key.p12
. - Password: Enter a password (remember it).
- Confirm Password: Re-enter the password. Click OK.
-
Key Store file: Select where to save the Key. Here, choose the "~/profiles_backup" folder and name the file
Enter an Alias (remember this as well). The window should look like this:
Click Next to complete key creation and proceed to the CSR creation page.
Here, note that the CSR file is the location where the CSR will be saved, not an existing CSR file. Again, select the "~/profiles_backup" folder and name the file
csr.csr
.
Click Finish to complete. You can now find the generated certificate files in "~/profiles_backup".
Upload Certificate File and Download
Add the certificate in AppGallery. The name can be arbitrary, type should be "Release Certificate", and for CSR select the file you just prepared. After adding, click Download to get the .cer
file. It is recommended to save it in the same directory as the CSR, e.g., "~/profiles_backup".
Add Profile and Download
Select your app, select the release certificate, choose the certificate you just added, and click Download Profile. It is best to save it in the same place as your key files, e.g., "~/profiles_backup".
Check Files
You should now have the following files:
-
.p12
file -
.csr
file -
.cer
file -
.p7b
file
At this point, all the materials required for signing are ready.
Signing
Configure Signing
Click the target icon in the top right corner, change the build mode to "release", and click Apply to save.
Build
Go to Build -> Build Hap(s)/APP(s) -> Build APP(s)
Output Path
The output path is under the build
directory at the same level as AppScope in your project. The file with signed
in its name is the signed release package.
Top comments (0)