提交 bc375f5a 编写于 作者: O openharmony_ci 提交者: Gitee

!619 更新IDE使用指导英文内容

Merge pull request !619 from 杨林/master
......@@ -3,7 +3,7 @@
- [DevEco Studio \(OpenHarmony\) User Guide](deveco-studio-(openharmony)-user-guide.md)
- [Overview](overview.md)
- [Configuring the OpenHarmony SDK](configuring-the-openharmony-sdk.md)
- [Importing an OpenHarmony Project](importing-an-openharmony-project.md)
- [Creating an OpenHarmony Project](creating-an-openharmony-project.md)
- [Configuring the OpenHarmony App Signature](configuring-the-openharmony-app-signature.md)
- [Installing and Running Your OpenHarmony App](installing-and-running-your-openharmony-app.md)
......
......@@ -11,21 +11,18 @@ Before running and debugging the OpenHarmony app on a real device, you need to s
## Generating a Key Store and CSR<a name="section153146467405"></a>
OpenHarmony uses digital certificates \(.cer\) and **Profile** files \(.p7b\) to ensure app integrity. Before applying for these files, you need to generate a key store \(.p12\) and a certificate signing request \(.csr\). You can do so in DevEco Studio or a command-line tool. For details, see [Generating a Key Store and CSR](https://developer.harmonyos.com/en/docs/documentation/doc-guides/ide_debug_device-0000001053822404#EN-US_TOPIC_0000001154985555__section837891802519).
OpenHarmony uses digital certificates \(.cer\) and **Profile** files \(.p7b\) to ensure app integrity. Before applying for these files, you need to generate a key store \(.p12\) and a certificate signing request \(.csr\). You can do so in DevEco Studio or a command-line tool. For details, see [Generating a Key Store and CSR](https://developer.harmonyos.com/en/docs/documentation/doc-guides/publish_app-0000001053223745#section9752152162813).
## Generating an App Certificate<a name="section136609429562"></a>
Use the CSR generated in [Generating a Key Store and CSR](#section153146467405) to generate the digital certificate required for app signing. The method is as follows:
Go to the **Sdk\\toolchains\\lib** directory in the DevEco Studio installation directory, and run the following command in the CLI \(if the **keytool** command cannot be executed, add the JDK environment variables to the system environment variables\). You only need to modify the input and output to quickly generate a certificate. That is, modify **-infile** to specify the path of the CSR and **-outfile** to specify the name and path of the output certificate.
Go to the **Sdk\\toolchains\\lib** directory where the OpenHarmony SDK is saved \(see [Configuring the OpenHarmony SDK](configuring-the-openharmony-sdk.md) for details\) in the DevEco Studio installation directory, and run the following command in the CLI. If the **keytool** command cannot be executed, add the JDK environment variables to the system environment variables. You only need to modify the input and output to quickly generate a certificate. That is, modify **-infile** to specify the path of the CSR and **-outfile** to specify the name and path of the output certificate.
```
keytool -gencert -alias "OpenHarmony Application CA" -infile app.csr -outfile IDE.cer -keystore OpenHarmony.p12 -sigalg SHA384withECDSA -storepass 123456 -ext KeyUsage:"critical=digitalSignature" -validity 3650 -rfc
keytool -gencert -alias "OpenHarmony Application CA" -infile myApplication_debug.csr -outfile myApplication_debug.cer -keystore OpenHarmony.p12 -sigalg SHA384withECDSA -storepass 123456 -ext KeyUsage:"critical=digitalSignature" -validity 3650 -rfc
```
>![](public_sys-resources/icon-note.gif) **NOTE:**
>In the preceding command, the fields in blue cannot be modified. Otherwise, the certificate cannot be generated.
Refer to the following descriptions about the parameters in the command:
- **alias**: alias of the CA private key used for issuing certificates. The CA private key of the OpenHarmony community is stored in the **OpenHarmony.p12** key store file. This parameter cannot be modified.
......@@ -45,12 +42,9 @@ The profile contains the package name of the OpenHarmony app, digital certificat
Go to the **Sdk\\toolchains\\lib** directory, open the command-line tool, and run the following command.
```
java -jar provisionsigtool.jar sign --in UnsgnedReleasedProfileTemplate.json --out SgnedReleasedProfileTemplate.p7b --keystore OpenHarmony.p12 --storepass 123456 --alias "OpenHarmony Application Profile Release" --sigAlg SHA256withECDSA --cert OpenHarmonyProfileRelease.pem --validity 365 --developer-id ohosdeveloper --java -jar provisionsigtool.jar sign --in UnsgnedReleasedProfileTemplate.json --out SgnedReleasedProfileTemplate.p7b --keystore OpenHarmony.p12 --storepass 123456 --alias "OpenHarmony Application Profile Release" --sigAlg SHA256withECDSA --cert OpenHarmonyProfileRelease.pem --validity 365 --developer-id ohosdeveloper --bundle-name package name --permission restricted permission name (optional) --permission restricted permission name (optional) --distribution-certificate IDE.cer
java -jar provisionsigtool.jar sign --in UnsgnedReleasedProfileTemplate.json --out myApplication_debug_Provision.p7b --keystore OpenHarmony.p12 --storepass 123456 --alias "OpenHarmony Application Profile Release" --sigAlg SHA256withECDSA --cert OpenHarmonyProfileRelease.pem --validity 365 --developer-id ohosdeveloper --bundle-name package name --permission restricted permission name (optional) --permission restricted permission name (optional) --distribution-certificate myApplication_debug.cer
```
>![](public_sys-resources/icon-note.gif) **NOTE:**
>In the preceding command, the fields in blue cannot be modified. Otherwise, the profile cannot be generated.
Refer to the following descriptions about the parameters in the command:
- **provisionsigtool**: tool for generating the profile which is stored in **Sdk\\toolchains\\lib** of the OpenHarmony SDK.
......@@ -59,7 +53,7 @@ Refer to the following descriptions about the parameters in the command:
- **keystore**: path of the key store for issuing certificates. The name of the OpenHarmony key store file is **OpenHarmony.p12**. The file is stored in **Sdk\\toolchains\\lib** of the OpenHarmony SDK. This parameter cannot be modified.
- **storepass**: key store password. The password is **123456** and cannot be changed.
- **alias**: alias of the private key used for app signing. The CA private key of the OpenHarmony community is stored in the **OpenHarmony.p12** key store file. This parameter cannot be modified.
- **sigalg**: certificate signing algorithm. This parameter cannot be modified.
- **sigalg**: certificate signature algorithm. This parameter cannot be modified.
- **cert**: path of the certificate of the signature profile. The file is stored in **Sdk\\toolchains\\lib** of the OpenHarmony SDK. This parameter cannot be modified.
- **validity**: certificate validity period, which is user-defined.
- **developer-id**: developer ID, which is a user-defined character string.
......@@ -78,14 +72,14 @@ Go to **File** \> **Project Structure** \> **Project** \> **Signing Confi
- **Key Alias**: Enter the alias of the key, which is the same as the alias entered in [Generating a Key Store and CSR](#section153146467405).
- **Key Password**: Enter the key password, which is the same as the value of **Store Password**.
- **Sign Alg**: Specify the signature algorithm, which has a fixed value of **SHA256withECDSA**.
- **Profile File**: Select the obtained debug profile in .p7b format.
- **Certpath File**: Select the obtained debug certificate in .cer format.
- **Profile File**: Select the .p7b profile file generated in [Generating the App Profile](#section2048641015325).
- **Certpath File**: Select the .cer debug certificate generated in [Generating an App Certificate](#section136609429562).
![](figures/en-us_image_0000001117638220.png)
![](figures/en-us_image_0000001144765960.png)
Click **OK** to save your configurations. Then you can view the signature configuration information in **build.gradle** of the project.
![](figures/en-us_image_0000001117638526.png)
![](figures/en-us_image_0000001144606358.png)
By default, the type of a HAP package compiled using DevEco Studio is set to **debug**. For a release type, click the **OhosBuild Variants** tab in the lower left corner of the project and set the type to **release**. For details about how to compile and build the HAP, see [HUAWEI DevEco Studio User Guide](https://developer.harmonyos.com/en/docs/documentation/doc-guides/build_hap-0000001053342418).
......
......@@ -10,8 +10,8 @@ To set up the OpenHarmony app development environment, configure the correspondi
## Prerequisites<a name="section164161442154812"></a>
- DevEco Studio 2.1 Release version has been downloaded and installed. You can click [here](https://developer.harmonyos.com/en/develop/deveco-studio#download) to download it.
- The OpenHarmony SDK package has been obtained and decompressed. You can click [here](https://mirror.iscas.ac.cn/OpenHarmony/sdk/OpenHarmony-SDK-2.0-Canary.7z) to download it.
- [DevEco Studio 2.1 Release](https://developer.harmonyos.com/en/develop/deveco-studio#download) or later has been downloaded and installed.
- The [OpenHarmony SDK](https://mirror.iscas.ac.cn/OpenHarmony/sdk/) package has been obtained and decompressed.
## Configuring the SDK Information<a name="section1265592425017"></a>
......@@ -65,7 +65,7 @@ DevEco Studio manages SDKs and toolchains using SDK Manager. OpenHarmony contain
![](figures/en-us_image_0000001162781359.png)
4. Go to the **Sdk\\js\\2.2.0.0\\build-tools\\ace-loader** directory, run the following commands in CLI, and wait until the installation is complete.
4. Go to the **Sdk\\js\\_version number_\\build-tools\\ace-loader** directory, run the following commands in CLI, and wait until the installation is complete.
```
npm cache clean -f
......
# Creating an OpenHarmony Project<a name="EN-US_TOPIC_0000001130929834"></a>
- **[Using the Project Wizard to Create a Project](using-the-project-wizard-to-create-a-project.md)**
- **[Importing a Sample to Create a Project](importing-a-sample-to-create-a-project.md)**
......@@ -4,7 +4,7 @@
- **[Configuring the OpenHarmony SDK](configuring-the-openharmony-sdk.md)**
- **[Importing an OpenHarmony Project](importing-an-openharmony-project.md)**
- **[Creating an OpenHarmony Project](creating-an-openharmony-project.md)**
- **[Configuring the OpenHarmony App Signature](configuring-the-openharmony-app-signature.md)**
......
# Importing an OpenHarmony Project<a name="EN-US_TOPIC_0000001163914943"></a>
# Importing a Sample to Create a Project<a name="EN-US_TOPIC_0000001163914943"></a>
After the OpenHarmony SDK is configured, you can start developing your app only by **importing a sample project** to begin with.
>![](public_sys-resources/icon-note.gif) **NOTE:**
>This feature applies to OpenHarmony projects created using DevEco Studio 2.1 Release or later.
Sample projects for OpenHarmony app development are supported. Import a sample project with the following description: **This sample is intended for novices at developing OpenHarmony applications.**. For example, the **JsHelloWorld** sample in the **common** category.
After the OpenHarmony SDK is configured, you can get started to develop your app by **importing a sample project**.
![](figures/en-us_image_0000001165463605.png)
1. On the DevEco Studio welcome page, go to **Configure** \(or ![](figures/en-us_image_0000001118018452.png) icon\) \> **Settings** \> **Version Control** \> **Git** and click **Test** to check whether the Git tool is installed.
1. On the DevEco Studio welcome page, select **Configure** or click the ![](figures/en-us_image_0000001118018452.png) icon, and choose **Settings** \> **Version Control** \> **Git**. Then click **Test** to check whether the Git tool has been installed.
- If the tool has been installed, import a sample by referring to [2](#li5947194711181).
![](figures/en-us_image_0000001118018088.png)
......@@ -15,28 +14,19 @@ Sample projects for OpenHarmony app development are supported. Import a sample p
![](figures/en-us_image_0000001164498191.png)
2. <a name="li5947194711181"></a>On the DevEco Studio welcome page, click **Import HarmonyOS Sample** to import a sample project.
![](figures/en-us_image_0000001163835551.png)
3. Go to **common** \> **JsHelloWorld** \> **Next**.
3. Choose **OpenHarmony Samples** \> **common** \> **JsHelloWorld** \> **Next**.
![](figures/en-us_image_0000001118201202.png)
![](figures/en-us_image_0000001152459178.png)
4. Configure **App Name** and **Project Location** and click **Finish**. Wait until the sample project is imported.
![](figures/en-us_image_0000001163915521.png)
5. Open the **build.gradle** file in the project and change the version number of the HAP plugin to **2.4.4.3-RC**.
![](figures/en-us_image_0000001117475776.png)
6. Click ![](figures/en-us_image_0000001163835553.png) under **Gradle** in the upper right corner to sync the project again.
![](figures/en-us_image_0000001117635680.png)
7. When the project is successfully synced, you can develop your OpenHarmony app.
5. When the project is successfully synced, start developing your OpenHarmony app.
![](figures/en-us_image_0000001163915523.png)
......
......@@ -37,5 +37,5 @@ The hdc commands are as follows:
```
For details about how to use the hdc tool and the command format, see [hdc_std Usage Guidelines](../../device-dev/subsystems/oem_subsys_toolchain_hdc_guide.md).
For details about how to use the hdc tool and the command format, see the open-source repository **docs/en/device-dev/subsystems/hdc-usage-guidelines.md**.
......@@ -11,7 +11,7 @@ DevEco Studio is an integrated development environment \(IDE\) of HarmonyOS apps
The process of developing an OpenHarmony app using DevEco Studio is the same as that of developing a HarmonyOS app. This document describes the differences between OpenHarmony and HarmonyOS app development.
- **Environment setup**: You need to manually configure the SDK for the OpenHarmony app development. For details, see [Configuring the OpenHarmony SDK](configuring-the-openharmony-sdk.md).
- **OpenHarmony project import**: To develop an OpenHarmony app, you can only import a sample project to start with. For details, see [Importing an OpenHarmony Project](importing-an-openharmony-project.md).
- **OpenHarmony project import**: To develop an OpenHarmony app, you can only import a sample project to start with. For details, see [Importing a Sample to Create a Project](importing-a-sample-to-create-a-project.md).
- **Signature configuration for debugging**: To run an OpenHarmony app on a real device, you need to sign the app first. For instructions, see [Configuring the OpenHarmony App Signature](configuring-the-openharmony-app-signature.md).
- **App running on a real device**: To run your app on a real device, you need to use the hdc tool to push the HAP package of the OpenHarmony to the real device for installation. For details, see [Installing and Running Your OpenHarmony App](installing-and-running-your-openharmony-app.md).
......
# Using the Project Wizard to Create a Project<a name="EN-US_TOPIC_0000001176969367"></a>
- [Prerequisites](#section13642104391619)
- [Procedure](#section132671712101714)
If you are using DevEco Studio 2.2 Beta1 or later, you can use the project wizard to create a project. If you are using DevEco Studio 2.1 Release, create a project by following instructions in [Importing a Sample to Create a Project](importing-a-sample-to-create-a-project.md).
## Prerequisites<a name="section13642104391619"></a>
The OpenHarmony SDK has been installed. For details, see [Configuring the OpenHarmony SDK](configuring-the-openharmony-sdk.md).
## Procedure<a name="section132671712101714"></a>
1. Open the project wizard using either of the following methods:
- If no project is open, select **Create HarmonyOS Project** on the welcome page.
- If a project is already open, choose **File** \> **New** \> **New Project** on the menu bar.
2. Select the **\[Standard\]Empty Ability\(JS\)** template and click **Next**.
![](figures/en-us_image_0000001177051523.png)
3. Click **Next** and configure the project.
- **Project Name**: customized project name.
- **Project Type**: project type , which can be an [atomic service](https://developer.harmonyos.com/en/docs/documentation/doc-guides/atomic-service-definition-0000001090840664) or an ordinary app that requires download before use.
>![](public_sys-resources/icon-note.gif) **NOTE:**
>If you're creating an atomic service:
>- There is no app icon on the home screen while running or debugging an atomic service. Use the debugging and running functions of DevEco Studio as an alternative.
>- Atomic services are installation free. This is done by automatically adding the **installationFree** field to the **config.json** file, with its value set to **true**.
>- If the value of the **installationFree** field of the entry module is set to **true**, the value of the **installationFree** field of all the related HAP modules is **true** by default. If the** installationFree field** of the entry module is set to **false**, the **installationFree** field of all the related HAP modules can be set to **true** or **false**.
>- When compiling and building an app, make sure that the size of each HAP package does not exceed 10 MB.
- **Package Name**: software package name. By default, this name will also be used as your app ID. Assign a unique package name because your app must have a unique ID to be released.
- **Save Location**: local path for storing the project file.
- **Compatible API Version**: earliest SDK version compatible with your app.
- **Device Type**: device type supported by the project template.
![](figures/en-us_image_0000001130932554.png)
4. Click **Finish**. DevEco Studio will automatically generate the sample code and resources that match your project type. Wait until the project is created.
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册