提交 db19d2fa 编写于 作者: Z zengyawen

update docs

Signed-off-by: Nzengyawen <zengyawen1@huawei.com>
上级 78f62b8c
- [Application Development Overview](application-dev-guide.md)
- Quick Start
- Getting Started with Application Development
- DevEco Studio (OpenHarmony) User Guide
- [Overview](quick-start/deveco-studio-overview.md)
- [Version Change History](quick-start/deveco-studio-release-notes.md)
- [Configuring the OpenHarmony SDK](quick-start/configuring-openharmony-sdk.md)
- Creating an OpenHarmony Project
- [Using the Project Wizard to Create a Project](quick-start/use-wizard-to-create-project.md)
- [Importing a Sample to Create a Project](quick-start/import-sample-to-create-project.md)
- [Configuring the OpenHarmony App Signature](quick-start/configuring-openharmony-app-signature.md)
- [Installing and Running Your OpenHarmony App](quick-start/installing-openharmony-app.md)
- [Directory Structure](quick-start/package-structure.md)
- [Resource File Categories](quick-start/basic-resource-file-categories.md)
- Development
......@@ -24,7 +14,7 @@
- Other
- [Ability Assistant Usage](ability/ability-assistant-guidelines.md)
- [UI]](ui/Readme-EN.md)
- [UI](ui/Readme-EN.md)
- JavaScript-based Web-Like Development Paradigm
- [Overview](ui/ui-js-overview.md)
- Framework
......@@ -213,13 +203,7 @@
- [Overview of Distributed Call Chain Tracing](dfx/hitracechain-overview.md)
- [Development of Distributed Call Chain Tracing](dfx/hitracechain-guidelines.md)
- Tools
- DevEco Studio (OpenHarmony) User Guide
- [Overview](quick-start/deveco-studio-overview.md)
- [Version Change History](quick-start/deveco-studio-release-notes.md)
- [Configuring the OpenHarmony SDK](quick-start/configuring-openharmony-sdk.md)
- [Creating an OpenHarmony Project](quick-start/create-openharmony-project.md)
- [Configuring the OpenHarmony App Signature](quick-start/configuring-openharmony-app-signature.md)
- [Installing and Running Your OpenHarmony App](quick-start/installing-openharmony-app.md)
- [DevEco Studio (OpenHarmony) User Guide](quick-start/deveco-studio-user-guide-for-openharmony.md)
- Hands-On Tutorials
- [Samples](https://gitee.com/openharmony/app_samples/blob/master/README.md)
- API References
......
# Basics
- [DevEco Studio \(OpenHarmony\) User Guide](deveco-studio-user-guide-for-openharmony.md)
- [Overview](deveco-studio-overview.md)
- [Version Change History](deveco-studio-release-notes.md)
- [Configuring the OpenHarmony SDK](configuring-openharmony-sdk.md)
- [Creating an OpenHarmony Project](create-openharmony-project.md)
- [Using the Project Wizard to Create a Project](use-wizard-to-create-project.md)
- [Importing a Sample to Create a Project](import-sample-to-create-project.md)
- [Configuring the OpenHarmony App Signature](configuring-openharmony-app-signature.md)
- [Installing and Running Your OpenHarmony App](installing-openharmony-app.md)
- [Directory Structure](package-structure.md)
- Development Fundamentals
- [Directory Structure](package-structure.md)
- [Resource File](basic-resource-file-categories.md)
# Configuring the OpenHarmony App Signature<a name="EN-US_TOPIC_0000001159890371"></a>
- [Generating a Key Store and CSR](#section153146467405)
- [In DevEco Studio](#section1298903211472)
- [In a Command-Line Tool](#section1276462024811)
- [Generating an App Certificate](#section136609429562)
- [Generating the App Profile](#section2048641015325)
- [Configuring App Signature Information](#section10152423193310)
Before running and debugging the OpenHarmony app on a real device, you need to sign the app. This section describes how to configure the signature of an OpenHarmony app. Operation instructions are the same in _HUAWEI DevEco Studio User Guide_ except this section. For details, see [HUAWEI DevEco Studio User Guide](https://developer.harmonyos.com/en/docs/documentation/doc-guides/tools_overview-0000001053582387). See the following figure for the process of configuring app signature information.
![](figures/en-us_image_0000001113808114.png)
## 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.
### In DevEco Studio<a name="section1298903211472"></a>
1. On the menu bar, choose **Build** \> **Generate Key and CSR**.
>![](../public_sys-resources/icon-note.gif) **NOTE:**
>If you have a local key, click **Skip** in the **Generate Key** window and use the key to generate a CSR file.
2. In **Key Store File**, click **Choose Existing** to select an existing key store \(.p12 file that contains a key\) or **New** to create one. The following describes how to create a key store.
![](figures/en-us_image_0000001119560738.png)
3. In the **Create Key Store** dialog box, set the following parameters and click **OK**.
- **Key Store File**: Select the path for storing the key store.
- **Password**: Set the key store password, which must contain at least 8 characters that include two types of the following: uppercase letters, lowercase letters, digits, and special characters. Do not lose the password as it will be used later in configuring the signature.
- **Confirm Password**: Enter the key store password again.
![](figures/en-us_image_0000001152674854.png)
4. In the **Generate Key** window, set the following parameters and click **Next**.
- **Alias**: Enter the alias of the key, which is used to identify the key name. Do not lose the alias as it will be used later in configuring the signature.
- **Password**: password of the key, which is automatically filled in and the same as the keystore password.
- **Validity**: Specify the certificate validity period. A validity period of 25 years or longer is recommended to cover the entire lifecycle of your app/service.
- **Certificate**: Enter basic certificate information.
![](figures/en-us_image_0000001117639668.png)
5. In the **Generate CSR** window, select the key and set the storage path of the CSR file.
![](figures/en-us_image_0000001117479776.png)
6. Click **OK**. You can then obtain the generated keystore file \(.p12\) and CSR file \(.csr\) from the storage path.
![](figures/en-us_image_0000001163839541.png)
### In a Command-Line Tool<a name="section1276462024811"></a>
Use the Keytool in the Open JDK to generate a CSR.
1. Run the Keytool as an administrator.
![](figures/en-us_image_0000001248045243.png)
2. Switch to the directory where the Keytool is located.
![](figures/en-us_image_0000001247125297.png)
3. Run the following command to generate a key store. This example creates a key store named **ide\_demo\_app.p12** and saves it to the root directory of the D drive.
```
keytool -genkeypair -alias "ide_demo_app" -keyalg EC -sigalg SHA256withECDSA -dname "C=CN,O=Organization,OU=Unit,CN=ide_demo_app" -keystore d:\\idedemokey.p12 -storetype pkcs12 -validity 9125 -storepass 123456Abc -keypass 123456Abc
```
Parameters in the key store:
>![](../public_sys-resources/icon-note.gif) **NOTE:**
>Record the values of **alias**, **storepass**, and **keypass**, which will be used in [Configuring App Signature Information](#section10152423193310).
- **alias**: alias of the key, which is used to identify the key name.
- **sigalg**: signature algorithm, which is automatically set to **SHA256withECDSA** and cannot be changed.
- **dname**:
- **C**: country/region code, such as **CN**.
- **O**: organization name, such as **Organization**.
- **OU**: organization unit name, such as **Unit**.
- **CN**: your first name and last name. Set this parameter to be the same as **alias**.
- **validity**: certificate validity period. It is recommended that you set this parameter to **9125** \(25 years\).
- **storepass**: key store password, which must contain at least 8 characters that include two types of the following: uppercase letters, lowercase letters, digits, and special characters. Do not lose the password as it will be used later in configuring the signature.
- **keypass**: password of the key. The value must be the same as that of **storepass**.
4. Run the following command. After the command is executed, enter the **storepass** to generate a CSR in .csr format.
```
keytool -certreq -alias "ide_demo_app" -keystore d:\\idedemokey.p12 -storetype pkcs12 -file d:\\idedemokey.csr
```
Parameters in the CSR:
- **alias**: The value must be the same as the alias set in 3.
- **file**: name of the generated CSR. The file name extension is .csr.
## 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 where the OpenHarmony SDK is saved \(see [Configuring the OpenHarmony SDK](configuring-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 myApplication_ohos.csr -outfile myApplication_ohos.cer -keystore OpenHarmony.p12 -sigalg SHA384withECDSA -storepass 123456 -ext KeyUsage:"critical=digitalSignature" -validity 3650 -rfc
```
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.
- **infile**: path of the CSR file.
- **outfile**: name and path of the certificate chain file.
- **keystore**: path of the CA 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. Note that the **OpenHarmony.p12** file is not the .p12 file generated in [Generating a Key Store and CSR](#section153146467405).
- **sigalg**: certificate signature algorithm. This parameter cannot be modified.
- **storepass**: key store password. The password is **123456** and cannot be changed.
- **ext**: certificate extension. This parameter cannot be modified.
- **validity**: certificate validity period, which is user-defined.
- **rfc**: specifies the output file format. This parameter cannot be modified.
## Generating the App Profile<a name="section2048641015325"></a>
The profile contains the following information about the OpenHarmony app: bundle name, digital certificate information, certificate permissions that can be applied for by the app, and devices where the app can be debugged \(the device list will be empty if the app type is Release\). Each app package must contain a profile file.
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 myApplication_ohos_Provision.p7b --keystore OpenHarmony.p12 --storepass 123456 --alias "OpenHarmony Application Profile Release" --sigAlg SHA256withECDSA --cert OpenHarmonyProfileRelease.pem --validity 365 --developer-id ohosdeveloper --bundle-name app bundle name --permission restricted permission name (optional) --permission restricted permission name (optional) --distribution-certificate myApplication_ohos.cer
```
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.
- **in**: path of the profile template which is stored in **Sdk\\toolchains\\lib** of the OpenHarmony SDK. This parameter cannot be modified.
- **out**: name and path of the profile.
- **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 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.
- **bundle-name**: app bundle name.
- **permission** \(optional\): If permissions are not required, this field can be left empty. You can add multiple restricted permissions in the following way: ohos.permission.READ\_CONTACTS, ohos.permission.WRITE\_CONTACTS.
- **distribution-certificate**: certificate generated in [Generating an App Certificate](#section136609429562).
## Configuring App Signature Information<a name="section10152423193310"></a>
Before debugging on a real device, use the private key file \(.p12\), certificate file \(.cer\), and profile file \(.p7b\) to sign the target module.
Go to **File** \> **Project Structure** \> **Project** \> **Signing Configs** \> **debug**, deselect **Automatically generate signing**, and configure the signature information of the specified module.
- **Store File**: Select the key store file with the file name extension .p12, which is generated in [Generating a Key Store and CSR](#section153146467405).
- **Store Password**: Enter the key store password, which is the same as the key store password entered in [Generating a Key Store and CSR](#section153146467405).
- **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 .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_0000001155643492.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_0000001202722349.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).
![](figures/en-us_image_0000001115066116.png)
After the compilation is complete, you can obtain the HAP package of your OpenHarmony app from the **build** directory of the project.
![](figures/en-us_image_0000001163918627.png)
# Configuring the OpenHarmony SDK<a name="EN-US_TOPIC_0000001113561194"></a>
- [Prerequisites](#section164161442154812)
- [Configuring the SDK Information](#section1265592425017)
- [References](#section0384143616409)
- [Setting Up the DevEco Studio Proxy](#section10129720184214)
- [Setting Up the npm Proxy](#section19984059114316)
- [Setting Up the Gradle Proxy](#section164211820465)
To set up the OpenHarmony app development environment, configure the corresponding SDK information in DevEco Studio first.
>![](../public_sys-resources/icon-note.gif) **NOTE:**
>The OpenHarmony SDK is not applicable to HarmonyOS app development, with some necessary toolchains removed.
## Prerequisites<a name="section164161442154812"></a>
[DevEco Studio 3.0 Beta1](https://developer.harmonyos.com/cn/develop/deveco-studio#download) or later has been downloaded and installed.
## Configuring the SDK Information<a name="section1265592425017"></a>
DevEco Studio manages SDKs and toolchains using SDK Manager. OpenHarmony contains the following SDK packages:
<a name="table64565810577"></a>
<table><thead align="left"><tr id="row12455580576"><th class="cellrowborder" valign="top" width="24.709999999999997%" id="mcps1.1.4.1.1"><p id="p34565812572"><a name="p34565812572"></a><a name="p34565812572"></a>Type</p>
</th>
<th class="cellrowborder" valign="top" width="25.3%" id="mcps1.1.4.1.2"><p id="p104675817575"><a name="p104675817575"></a><a name="p104675817575"></a>Package Name</p>
</th>
<th class="cellrowborder" valign="top" width="49.99%" id="mcps1.1.4.1.3"><p id="p194610586574"><a name="p194610586574"></a><a name="p194610586574"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row44334409916"><td class="cellrowborder" rowspan="2" valign="top" width="24.709999999999997%" headers="mcps1.1.4.1.1 "><p id="p88381448125813"><a name="p88381448125813"></a><a name="p88381448125813"></a>SDK</p>
</td>
<td class="cellrowborder" valign="top" width="25.3%" headers="mcps1.1.4.1.2 "><p id="p1946175813574"><a name="p1946175813574"></a><a name="p1946175813574"></a>JS</p>
</td>
<td class="cellrowborder" valign="top" width="49.99%" headers="mcps1.1.4.1.3 "><p id="p54625885713"><a name="p54625885713"></a><a name="p54625885713"></a>SDK for JS.</p>
</td>
</tr>
<tr id="row12199716103617"><td class="cellrowborder" valign="top" headers="mcps1.1.4.1.1 "><p id="p9200131683616"><a name="p9200131683616"></a><a name="p9200131683616"></a>eTS</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.1.4.1.2 "><p id="p523912359172"><a name="p523912359172"></a><a name="p523912359172"></a>SDK for Extended TypeScript (eTS).</p>
</td>
</tr>
<tr id="row14474585576"><td class="cellrowborder" rowspan="2" valign="top" width="24.709999999999997%" headers="mcps1.1.4.1.1 "><p id="p124765819578"><a name="p124765819578"></a><a name="p124765819578"></a>SDK Tool</p>
</td>
<td class="cellrowborder" valign="top" width="25.3%" headers="mcps1.1.4.1.2 "><p id="p1947135818571"><a name="p1947135818571"></a><a name="p1947135818571"></a>Toolchains</p>
</td>
<td class="cellrowborder" valign="top" width="49.99%" headers="mcps1.1.4.1.3 "><p id="p7471158105711"><a name="p7471158105711"></a><a name="p7471158105711"></a>Includes compiling, packaging, signing, database management, and other tools that are required to develop OpenHarmony apps.</p>
</td>
</tr>
<tr id="row337931010"><td class="cellrowborder" valign="top" headers="mcps1.1.4.1.1 "><p id="p193791108"><a name="p193791108"></a><a name="p193791108"></a>Previewer</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.1.4.1.2 "><p id="p1238951018"><a name="p1238951018"></a><a name="p1238951018"></a>OpenHarmony app previewer, which can be used to view the UI layout during app development.</p>
</td>
</tr>
</tbody>
</table>
1. Open DevEco Studio. If this is the first time you are using it, select **Do not import settings** and click **OK**.
2. Follow the wizard to set **npm registry**. DevEco Studio has been preconfigured with the corresponding registry. Click **Start using DevEco Studio** to go to the next step.
>![](../public_sys-resources/icon-note.gif) **NOTE:**
>If the **Set up HTTP Proxy** page is displayed, it indicates that your network requires a proxy. In this case, set up the DevEco Studio proxy, npm proxy, and Gradle proxy according to [References](#section0384143616409), and then download the OpenHarmony SDK.
![](figures/en-us_image_0000001163314102.png)
3. Follow the wizard to download the SDK. By default, the OpenHarmony SDK will be downloaded. You can download the SDK to the default **user** directory or a local path that does not contain any Chinese characters. Then click **Next**.
![](figures/en-us_image_0000001208394019.png)
>![](../public_sys-resources/icon-note.gif) **NOTE:**
>If you are not using DevEco Studio for the first time, the SDK download page may not be displayed. In this case, go to **Configure** \(or ![](figures/en-us_image_0000001208274069.png)\) \> **Settings** \> **SDK Manager** \> **OpenHarmony SDK** and click **OpenHarmony SDK Location** to download the SDK.
4. On the **Settings Confirmation** page, click **Next**. When the **License Agreement** dialog box appears, click **Accept**.
![](figures/en-us_image_0000001163472654.png)
5. After the OpenHarmony SDK and tools are downloaded, click **Finish** to access the DevEco Studio welcome page.
![](figures/en-us_image_0000001163632602.png)
## References<a name="section0384143616409"></a>
Setting up the development environment requires that your network can directly access the Internet.
Generally, only some enterprise networks rather than personal area networks or home networks require a proxy to access the Internet.
If you are using DevEco Studio for the first time and the **Set up HTTP Proxy** page is displayed, it indicates that your network requires a proxy. In this case, set up the DevEco Studio proxy, npm proxy, and Gradle proxy.
![](figures/en-us_image_0000001166582138.png)
### Setting Up the DevEco Studio Proxy<a name="section10129720184214"></a>
1. Start DevEco Studio. On the **Set up HTTP Proxy** page that is displayed, select **Manual proxy configuration** and set the HTTP proxy.
>![](../public_sys-resources/icon-note.gif) **NOTE:**
>If this is not the first time you are using DevEco Studio:
>- On the welcome page, choose **Configure** \(or ![](figures/en-us_image_0000001212142015.png)\)** \> Settings \> Appearance & Behavior \> System Settings \> HTTP Proxy** to access the HTTP Proxy settings. \(For macOS, choose **Configure \> Preferences \> Appearance & Behavior \> System Settings \> HTTP Proxy**.\)
>- When on a project page, choose **File \> Settings \> Appearance & Behavior \> System Settings \> HTTP Proxy** to access the HTTP Proxy settings. \(For macOS, choose **DevEco Studio \> Preferences \> Appearance & Behavior \> System Settings \> HTTP Proxy**.\)
- **HTTP** parameters: **If you are not sure about the information, contact your network administrator.**
- **Host name**: Enter the host name or IP address of the proxy server.
- **Port number**: Enter the port number of the proxy server.
- **No proxy for**: Enter the URLs or IP addresses which the PC can directly connect to without a proxy server. Use commas \(,\) to separate URLs and IP addresses.
- **Proxy authentication** parameters: Set the parameters only when the proxy server requires authentication.
- **Login**: Enter the user name used to access the proxy server.
- **Password**: Enter the password used to access the proxy server.
- **Remember**: Select this option to remember the password.
![](figures/en-us_image_0000001212062065.png)
2. When you have finished, click **Check connection** and enter a URL to check the network connectivity. If the message "Connection successful" is displayed, it indicates that the proxy was set up successfully.
3. Click **Next: Configure npm** to set up the npm proxy. For details, see [Setting Up the npm Proxy](#section19984059114316).
### Setting Up the npm Proxy<a name="section19984059114316"></a>
Follow the configuration wizard of DevEco Studio to configure the npm proxy information, which will be written into the **.npmrc** file in the **users/**_user name_ directory.
>![](../public_sys-resources/icon-note.gif) **NOTE:**
>The configuration wizard is displayed only the first time you install DevEco Studio. If the wizard is not displayed, manually add the proxy information to the **.npmrc** file in the **users/**_user name_ directory.
- **npm registry**: Set the address of the npm registry. You are advised to select this option.
- **HTTP proxy**: Proxy server information. By default, the value is the same as that of **HTTP proxy** of DevEco Studio.
- **Enable Https Proxy**: Indicates whether to configure HTTPS proxy. You are advised to select this option.
![](figures/en-us_image_0000001164577336.png)
Click **Start using DevEco Studio**.
If your proxy server requires the user name and password for authentication, set the user name and password as follows. If your proxy server does not require authentication, skip this step and follow the instructions in [Configuring the SDK Information](#section1265592425017).
![](figures/en-us_image_0000001209817299.png)
1. Go to the **Users** directory and open the **.npmrc** file.
2. Modify the npm proxy information. Add the **user** and **password** fields to **proxy** and **https-proxy**. Note that the values may vary depending on the proxy. The following is an example:
```
proxy=http://user:password@proxy.server.com:80
https-proxy=http://user:password@proxy.server.com:80
```
>![](../public_sys-resources/icon-note.gif) **NOTE:**
>If the password contains special characters, such as @, \#, and \*, the configuration may not take effect. You are advised to replace the special characters with ASCII codes and add "%" before the ASCII codes. Refer to the following for the mapping between common symbols and ASCII codes.
>- !: %21
>- @: %40
>- \#: %23
>- ¥: %24
>- &: %26
>- \*: %2A
3. After the proxy is configured, open the CLI and run the following command to check whether the network is normal.
```
npm info express
```
If the following information is displayed after running the command, it indicates that the proxy has been set up successfully.
![](figures/en-us_image_0000001164417356.png)
4. When you are done, follow the instructions in [Configuring the SDK Information](#section1265592425017).
### Setting Up the Gradle Proxy<a name="section164211820465"></a>
1. Open **This PC**, and enter **%userprofile%** in the address box to access the user profile. \(For macOS, choose **Go** \> **Home**.\)
![](figures/en-us_image_0000001166740700.png)
2. Create a **.gradle** folder if there is none.
>![](../public_sys-resources/icon-note.gif) **NOTE:**
>Before creating a **.gradle** folder in macOS, set the system to show hidden files.
3. Open the **.gradle** folder, create a **gradle** file, and change the file name extension to .properties.
4. Add the following script to the **gradle.properties** file and save the file:
Modify the host name, port number, user name, password, and proxy exceptions \(**nonProxyHosts**\) based on the actual condition. Separate values for **nonProxyHosts** with a vertical bar \(|\).
```
systemProp.http.proxyHost=proxy.server.com
systemProp.http.proxyPort=8080
systemProp.http.nonProxyHosts=*.company.com|10.*|100.*
systemProp.http.proxyUser=userId
systemProp.http.proxyPassword=password
systemProp.https.proxyHost=proxy.server.com
systemProp.https.proxyPort=8080
systemProp.https.nonProxyHosts=*.company.com|10.*|100.*
systemProp.https.proxyUser=userId
systemProp.https.proxyPassword=password
```
# Creating an OpenHarmony Project<a name="EN-US_TOPIC_0000001130929834"></a>
- **[Using the Project Wizard to Create a Project](use-wizard-to-create-project.md)**
- **[Importing a Sample to Create a Project](import-sample-to-create-project.md)**
# Overview<a name="EN-US_TOPIC_0000001116414108"></a>
- [About the Document](#section189422248491)
- [Restrictions](#section65191625782)
- [DevEco Studio Evolution Roadmap](#section187875207166)
## About the Document<a name="section189422248491"></a>
DevEco Studio is an integrated development environment \(IDE\) of HarmonyOS apps. As HarmonyOS is developed based on OpenHarmony, DevEco Studio can also be used to develop OpenHarmony 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 install the OpenHarmony SDK for the OpenHarmony app development. For details, see [Configuring the OpenHarmony SDK](configuring-openharmony-sdk.md).
- **Creating an OpenHarmony project**: Create a project by using the project wizard or by importing a sample project. For details, see [Using the Project Wizard to Create a Project](use-wizard-to-create-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-openharmony-app-signature.md).
- **App running on a real device**: Push the OpenHarmony HAP package to the real device for installation. For details, see [Installing and Running Your OpenHarmony App](installing-openharmony-app.md).
For details about how to use DevEco Studio, see [HUAWEI DevEco Studio User Guide](https://developer.harmonyos.com/en/docs/documentation/doc-guides/tools_overview-0000001053582387).
## Restrictions<a name="section65191625782"></a>
- OpenHarmony supports only app development in eTS and JS.
- Developing OpenHarmony apps in DevEco Studio is supported on Windows.
DevEco Studio serves as a development tool for both OpenHarmony and HarmonyOS apps. Refer to the following table for descriptions about the functions not supported for OpenHarmony.
<a name="table852516933419"></a>
<table><thead align="left"><tr id="row1952618913415"><th class="cellrowborder" valign="top" width="29.882988298829883%" id="mcps1.1.4.1.1"><p id="p165268963418"><a name="p165268963418"></a><a name="p165268963418"></a>Feature</p>
</th>
<th class="cellrowborder" valign="top" width="36.783678367836785%" id="mcps1.1.4.1.2"><p id="p25262914349"><a name="p25262914349"></a><a name="p25262914349"></a>HarmonyOS</p>
</th>
<th class="cellrowborder" valign="top" width="33.33333333333333%" id="mcps1.1.4.1.3"><p id="p125265912343"><a name="p125265912343"></a><a name="p125265912343"></a>OpenHarmony</p>
</th>
</tr>
</thead>
<tbody><tr id="row955132319355"><td class="cellrowborder" valign="top" width="29.882988298829883%" headers="mcps1.1.4.1.1 "><p id="p1655172423517"><a name="p1655172423517"></a><a name="p1655172423517"></a>Service widgets</p>
</td>
<td class="cellrowborder" valign="top" width="36.783678367836785%" headers="mcps1.1.4.1.2 "><p id="p1555192493516"><a name="p1555192493516"></a><a name="p1555192493516"></a><strong id="b11551102403511"><a name="b11551102403511"></a><a name="b11551102403511"></a></strong></p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.1.4.1.3 "><p id="p85511324183514"><a name="p85511324183514"></a><a name="p85511324183514"></a><strong id="b255116244356"><a name="b255116244356"></a><a name="b255116244356"></a>X</strong></p>
</td>
</tr>
<tr id="row1552619933411"><td class="cellrowborder" valign="top" width="29.882988298829883%" headers="mcps1.1.4.1.1 "><p id="p11430122863614"><a name="p11430122863614"></a><a name="p11430122863614"></a>Automatic signing</p>
</td>
<td class="cellrowborder" valign="top" width="36.783678367836785%" headers="mcps1.1.4.1.2 "><p id="p243122863614"><a name="p243122863614"></a><a name="p243122863614"></a><strong id="b14431122873617"><a name="b14431122873617"></a><a name="b14431122873617"></a></strong></p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.1.4.1.3 "><p id="p4431162819362"><a name="p4431162819362"></a><a name="p4431162819362"></a><strong id="b4431328163619"><a name="b4431328163619"></a><a name="b4431328163619"></a>X</strong></p>
</td>
</tr>
<tr id="row115263913344"><td class="cellrowborder" valign="top" width="29.882988298829883%" headers="mcps1.1.4.1.1 "><p id="p1323118352362"><a name="p1323118352362"></a><a name="p1323118352362"></a>Remote emulator</p>
</td>
<td class="cellrowborder" valign="top" width="36.783678367836785%" headers="mcps1.1.4.1.2 "><p id="p723143573614"><a name="p723143573614"></a><a name="p723143573614"></a><strong id="b8231173533613"><a name="b8231173533613"></a><a name="b8231173533613"></a></strong></p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.1.4.1.3 "><p id="p7231435143619"><a name="p7231435143619"></a><a name="p7231435143619"></a><strong id="b1523111352363"><a name="b1523111352363"></a><a name="b1523111352363"></a>X</strong></p>
</td>
</tr>
<tr id="row183441037105115"><td class="cellrowborder" valign="top" width="29.882988298829883%" headers="mcps1.1.4.1.1 "><p id="p5345237155119"><a name="p5345237155119"></a><a name="p5345237155119"></a>Local emulator</p>
</td>
<td class="cellrowborder" valign="top" width="36.783678367836785%" headers="mcps1.1.4.1.2 "><p id="p393214320517"><a name="p393214320517"></a><a name="p393214320517"></a><strong id="b1693264315118"><a name="b1693264315118"></a><a name="b1693264315118"></a></strong></p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.1.4.1.3 "><p id="p139324438515"><a name="p139324438515"></a><a name="p139324438515"></a><strong id="b169321543175116"><a name="b169321543175116"></a><a name="b169321543175116"></a>X</strong></p>
</td>
</tr>
<tr id="row15269933419"><td class="cellrowborder" valign="top" width="29.882988298829883%" headers="mcps1.1.4.1.1 "><p id="p152318351369"><a name="p152318351369"></a><a name="p152318351369"></a>Using DevEco Studio for log viewing and optimization</p>
</td>
<td class="cellrowborder" valign="top" width="36.783678367836785%" headers="mcps1.1.4.1.2 "><p id="p623118353360"><a name="p623118353360"></a><a name="p623118353360"></a><strong id="b10231535143615"><a name="b10231535143615"></a><a name="b10231535143615"></a></strong></p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.1.4.1.3 "><p id="p192313353367"><a name="p192313353367"></a><a name="p192313353367"></a><strong id="b1423123514368"><a name="b1423123514368"></a><a name="b1423123514368"></a>X</strong></p>
</td>
</tr>
<tr id="row7357734143617"><td class="cellrowborder" valign="top" width="29.882988298829883%" headers="mcps1.1.4.1.1 "><p id="p76694468363"><a name="p76694468363"></a><a name="p76694468363"></a>Cloud testing</p>
</td>
<td class="cellrowborder" valign="top" width="36.783678367836785%" headers="mcps1.1.4.1.2 "><p id="p2066918465369"><a name="p2066918465369"></a><a name="p2066918465369"></a><strong id="b3669546133610"><a name="b3669546133610"></a><a name="b3669546133610"></a></strong></p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.1.4.1.3 "><p id="p1266910467363"><a name="p1266910467363"></a><a name="p1266910467363"></a><strong id="b11669144693616"><a name="b11669144693616"></a><a name="b11669144693616"></a>X</strong></p>
</td>
</tr>
<tr id="row124331939191517"><td class="cellrowborder" valign="top" width="29.882988298829883%" headers="mcps1.1.4.1.1 "><p id="p146691546143619"><a name="p146691546143619"></a><a name="p146691546143619"></a>Security testing</p>
</td>
<td class="cellrowborder" valign="top" width="36.783678367836785%" headers="mcps1.1.4.1.2 "><p id="p614815145371"><a name="p614815145371"></a><a name="p614815145371"></a><strong id="b101485149375"><a name="b101485149375"></a><a name="b101485149375"></a></strong></p>
</td>
<td class="cellrowborder" valign="top" width="33.33333333333333%" headers="mcps1.1.4.1.3 "><p id="p1514811149374"><a name="p1514811149374"></a><a name="p1514811149374"></a><strong id="b01481614133717"><a name="b01481614133717"></a><a name="b01481614133717"></a>X</strong></p>
</td>
</tr>
</tbody>
</table>
## DevEco Studio Evolution Roadmap<a name="section187875207166"></a>
Refer to the following figure for when the HUAWEI DevEco Studio support for OpenHarmony app development is available in different phases.
![](figures/en-us_image_0000001210018359.png)
# Version Change History<a name="EN-US_TOPIC_0000001210143219"></a>
- [V3.0 Beta2 \(2021-12-31\)](#section18825185716537)
- [Version Compatibility](#section8155205312218)
- [Version Change History](#section1655415918226)
- [V3.0 Beta1 \(2021-09-29\)](#section21092033115018)
## V3.0 Beta2 \(2021-12-31\)<a name="section18825185716537"></a>
### Version Compatibility<a name="section8155205312218"></a>
DevEco Studio 3.0 Beta2 is compatible with the module versions listed below.
<a name="table912419211138"></a>
<table><thead align="left"><tr id="row141241921231"><th class="cellrowborder" valign="top" width="31.009999999999998%" id="mcps1.1.4.1.1"><p id="p1112432111316"><a name="p1112432111316"></a><a name="p1112432111316"></a>Module</p>
</th>
<th class="cellrowborder" valign="top" width="36.02%" id="mcps1.1.4.1.2"><p id="p111241921039"><a name="p111241921039"></a><a name="p111241921039"></a>Version</p>
</th>
<th class="cellrowborder" valign="top" width="32.97%" id="mcps1.1.4.1.3"><p id="p863410439478"><a name="p863410439478"></a><a name="p863410439478"></a>Description</p>
</th>
</tr>
</thead>
<tbody><tr id="row14124221933"><td class="cellrowborder" valign="top" width="31.009999999999998%" headers="mcps1.1.4.1.1 "><p id="p17124172110319"><a name="p17124172110319"></a><a name="p17124172110319"></a>Gradle</p>
</td>
<td class="cellrowborder" valign="top" width="36.02%" headers="mcps1.1.4.1.2 "><p id="p101251821838"><a name="p101251821838"></a><a name="p101251821838"></a>7.3 (7.2 at minimum)</p>
</td>
<td class="cellrowborder" valign="top" width="32.97%" headers="mcps1.1.4.1.3 "><p id="p0634643124719"><a name="p0634643124719"></a><a name="p0634643124719"></a>DevEco Studio has Gradle 7.3 preinstalled. No separate installation is required.</p>
</td>
</tr>
<tr id="row1125172118320"><td class="cellrowborder" valign="top" width="31.009999999999998%" headers="mcps1.1.4.1.1 "><p id="p358213219512"><a name="p358213219512"></a><a name="p358213219512"></a>JDK</p>
</td>
<td class="cellrowborder" valign="top" width="36.02%" headers="mcps1.1.4.1.2 "><p id="p1412552119316"><a name="p1412552119316"></a><a name="p1412552119316"></a>11.0.x</p>
</td>
<td class="cellrowborder" valign="top" width="32.97%" headers="mcps1.1.4.1.3 "><p id="p76347438478"><a name="p76347438478"></a><a name="p76347438478"></a>DevEco Studio has JDK 11 preinstalled. No separate installation is required.</p>
</td>
</tr>
<tr id="row712518211231"><td class="cellrowborder" valign="top" width="31.009999999999998%" headers="mcps1.1.4.1.1 "><p id="p61257211232"><a name="p61257211232"></a><a name="p61257211232"></a>OpenHarmony SDK</p>
</td>
<td class="cellrowborder" valign="top" width="36.02%" headers="mcps1.1.4.1.2 "><p id="p141258211631"><a name="p141258211631"></a><a name="p141258211631"></a>3.1.0.0 (API Version 8 Beta)</p>
</td>
<td class="cellrowborder" valign="top" width="32.97%" headers="mcps1.1.4.1.3 "><p id="p363464312479"><a name="p363464312479"></a><a name="p363464312479"></a>This version is compatible with SDKs of earlier versions.</p>
</td>
</tr>
<tr id="row148771316264"><td class="cellrowborder" valign="top" width="31.009999999999998%" headers="mcps1.1.4.1.1 "><p id="p16276131516263"><a name="p16276131516263"></a><a name="p16276131516263"></a>Toolchinas</p>
</td>
<td class="cellrowborder" valign="top" width="36.02%" headers="mcps1.1.4.1.2 "><p id="p887713152611"><a name="p887713152611"></a><a name="p887713152611"></a>3.1.0.0</p>
</td>
<td class="cellrowborder" rowspan="3" valign="top" width="32.97%" headers="mcps1.1.4.1.3 "><p id="p14933418194918"><a name="p14933418194918"></a><a name="p14933418194918"></a>Update them to the latest version.</p>
</td>
</tr>
<tr id="row1792520182520"><td class="cellrowborder" valign="top" headers="mcps1.1.4.1.1 "><p id="p109251518258"><a name="p109251518258"></a><a name="p109251518258"></a>hap plug-in</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.1.4.1.2 "><p id="p14925111817513"><a name="p14925111817513"></a><a name="p14925111817513"></a>3.0.5.2</p>
</td>
</tr>
<tr id="row29251718254"><td class="cellrowborder" valign="top" headers="mcps1.1.4.1.1 "><p id="p109255186518"><a name="p109255186518"></a><a name="p109255186518"></a>decctest plug-in</p>
</td>
<td class="cellrowborder" valign="top" headers="mcps1.1.4.1.2 "><p id="p15925121819513"><a name="p15925121819513"></a><a name="p15925121819513"></a>1.2.7.2</p>
</td>
</tr>
</tbody>
</table>
### Version Change History<a name="section1655415918226"></a>
<a name="simpletable154972061571"></a>
<table id="simpletable154972061571"><tr id="strow04971366576"><td valign="top" id="stentry164971967578"><p id="p949718615570"><a name="p949718615570"></a><a name="p949718615570"></a><strong id="b3206161751212"><a name="b3206161751212"></a><a name="b3206161751212"></a>New Features</strong></p>
<a name="ul1978261655712"></a><a name="ul1978261655712"></a><ul id="ul1978261655712"><li>Introduced the Chinese UI. By default, the UI is displayed in English. To enable the Chinese UI, go to <strong id="b121121320121217"><a name="b121121320121217"></a><a name="b121121320121217"></a>Settings</strong>, choose <strong id="b7112102015129"><a name="b7112102015129"></a><a name="b7112102015129"></a>Plugins</strong> &gt; <strong id="b5112152017128"><a name="b5112152017128"></a><a name="b5112152017128"></a>installed</strong>, and select <strong id="b9113182071210"><a name="b9113182071210"></a><a name="b9113182071210"></a>Chinese (Simplified)</strong>. Then, restart DevEco Studio for the settings to take effect.</li><li>Introduced support for OpenHarmony apps and services, with various debugging features, from breakpoint management and variable observation to stepping.</li></ul>
<p id="p49051145125817"><a name="p49051145125817"></a><a name="p49051145125817"></a></p>
<p id="p7511347135817"><a name="p7511347135817"></a><a name="p7511347135817"></a><strong id="b6867529171215"><a name="b6867529171215"></a><a name="b6867529171215"></a>Enhanced Features</strong></p>
<a name="ul311913348114"></a><a name="ul311913348114"></a><ul id="ul311913348114"><li>Updated the OpenHarmony SDK to 3.1.0.0, whose API version is API 8 Beta and corresponding compilation and building plugin is 3.0.5.2.</li><li>Added an ability template that supports low-code development: <strong id="b736929122019"><a name="b736929122019"></a><a name="b736929122019"></a>[Standard]Empty Ability</strong>.</li><li>Added eTS component preview: allows previewing of eTS components; requires compileSdkVersion 8 or later.</li><li>Added eTS livee preview: allows viewing of the attribute changes in real time as you make them; requires compileSdkVersion 8 or later.</li></ul>
</td>
</tr>
</table>
## V3.0 Beta1 \(2021-09-29\)<a name="section21092033115018"></a>
<a name="simpletable19435134375015"></a>
<table id="simpletable19435134375015"><tr id="strow1435543185020"><td valign="top" id="stentry64351943115013"><div class="p" id="p13974162220455"><a name="p13974162220455"></a><a name="p13974162220455"></a><strong id="b0838112318282"><a name="b0838112318282"></a><a name="b0838112318282"></a>New Features</strong><a name="ul11381034104515"></a><a name="ul11381034104515"></a><ul id="ul11381034104515"><li>Added support for OpenHarmony SDK management. You can use SDK Manager to download and manage OpenHarmony SDKs.</li><li>Allowed for building of a single module during HAP compilation and building to accelerate building for multi-module projects; allowed for one-click re-building of HAPs, by automatically conducting the Clean Project operation before a HAP build.</li></ul>
</div>
<div class="p" id="p556811306614"><a name="p556811306614"></a><a name="p556811306614"></a><strong id="b0183135142820"><a name="b0183135142820"></a><a name="b0183135142820"></a>Enhanced Features</strong><a name="ul834518400613"></a><a name="ul834518400613"></a><ul id="ul834518400613"><li>Updated the compilation and building plugin to version 3.0.3.2.</li><li>Improved the JSON editor, which now enables quick rectification of resource index errors and instant access to resource values.</li><li>Provided Ohos and Project (default) views for projects, which you can switch between easily.</li><li>Enabled OpenHarmony projects to support Ark build.</li><li>Moved the <strong id="b19966587296"><a name="b19966587296"></a><a name="b19966587296"></a>supportSystem "standard"</strong> field, which is exclusive to OpenHarmony projects, from the module-level <strong id="b596638162911"><a name="b596638162911"></a><a name="b596638162911"></a>build.gradle</strong> file to the project-level <strong id="b199671680295"><a name="b199671680295"></a><a name="b199671680295"></a>build.gradle</strong> file.</li></ul>
</div>
</td>
</tr>
</table>
# DevEco Studio \(OpenHarmony\) User Guide<a name="EN-US_TOPIC_0000001163049851"></a>
- **[Overview](deveco-studio-overview.md)**
- **[Version Change History](deveco-studio-release-notes.md)**
- **[Configuring the OpenHarmony SDK](configuring-openharmony-sdk.md)**
- **[Creating an OpenHarmony Project](create-openharmony-project.md)**
- **[Configuring the OpenHarmony App Signature](configuring-openharmony-app-signature.md)**
- **[Installing and Running Your OpenHarmony App](installing-openharmony-app.md)**
# DevEco Studio \(OpenHarmony\) User Guide
# Importing a Sample to Create a Project<a name="EN-US_TOPIC_0000001163914943"></a>
>![](../public_sys-resources/icon-note.gif) **NOTE:**
>This feature applies to OpenHarmony projects created using DevEco Studio 2.1 Release or later.
After the OpenHarmony SDK is configured, you can get started to develop your app by **importing a sample project**.
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 following the instructions in Step 2.
![](figures/en-us_image_0000001118018088.png)
- If the tool hasn't been installed, click **Download and Install**. DevEco Studio will automatically download and install it. Then import a sample by following the instructions in Step 2.
![](figures/en-us_image_0000001164498191.png)
2. <a name="li5947194711181"></a>On the DevEco Studio welcome page, click **Import Sample** to import a sample project.
![](figures/en-us_image_0000001208006117.png)
3. Choose **OpenHarmony Samples** \> **common** \> **JsHelloWorld** \> **Next**.
![](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_0000001207744539.png)
5. When the project is successfully synced, start developing your OpenHarmony app.
![](figures/en-us_image_0000001163915523.png)
# Installing and Running Your OpenHarmony App<a name="EN-US_TOPIC_0000001115941596"></a>
You can install your OpenHarmony app in either of the following methods:
- DevEco Studio: Connect your device where the app is stored to DevEco Studio, and then click ![](figures/en-us_image_0000001239855207.png) to install the app.
- hdc: Run commands to install the app.
You can manually obtain the hdc tool from the open-source repository. Then, run the tool commands to install an HAP file on the device.
The tool commands are as follows:
- App installation
**install \[-r/-d/-g\] _package_**
Example:
```
hdc_std install E:\hwadmin.hap
```
- Log capturing
**hilog**
Example:
```
hdc_std hilog
```
For details about how to use hdc and the command format, see [hdc\_std Usage Guidelines](https://gitee.com/openharmony/docs/blob/master/en/device-dev/subsystems/subsys-toolchain-hdc-guide.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](import-sample-to-create-project.md).
## Prerequisites<a name="section13642104391619"></a>
The OpenHarmony SDK has been installed. For details, see [Configuring the OpenHarmony SDK](configuring-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 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** template and click **Next**.
![](figures/en-us_image_0000001162463400.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.
- **Bundle name**: bundle name. By default, this name will also be used as your app ID. Your app must have a unique ID to be released. If **Project type** is set to **Atomic service**, the **Bundle name** must end with **.hmservice**.
- **Save location**: local path for storing the project file.
- **Development mode**: development mode. The **Super Visual** option is available if the project template supports low-code development.
- **Language**: supported programming language.
- **Compatible API version**: earliest SDK version compatible with your app.
>![](../public_sys-resources/icon-note.gif) **NOTE:**
>If **compileSdkVersion 7** or later is configured for the OpenHarmony project, the corresponding module will be compiled using ArkCompiler by default. To use a compiler other than ArkCompiler, add the **arkEnable false** field to the **ohos** closure in the module-level **build.gradle** file.
- **Device Type**: device type supported by the project template.
![](figures/en-us_image_0000001196050928.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.
......@@ -58,6 +58,7 @@
- [WLAN](js-apis-wifi.md)
- [Bluetooth](js-apis-bluetooth.md)
- [RPC](js-apis-rpc.md)
- [Upload and Download](js-apis-request.md)
- Device Management
- [Sensor](js-apis-sensor.md)
- [Vibrator](js-apis-vibrator.md)
......@@ -80,6 +81,8 @@
- [Page Routing](js-apis-basic-features-routes.md)
- [Timer](js-apis-basic-features-timer.md)
- [Setting the System Time](js-apis-system-time.md)
- [Wallpaper](js-apis-wallpaper.md)
- [Pasteboard](js-apis-pasteboard.md)
- [Animation](js-apis-basic-features-animator.md)
- [WebGL](js-apis-webgl.md)
- [WebGL2](js-apis-webgl2.md)
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
......@@ -61,7 +61,7 @@ Before creating a project, you need to install DevEco Studio. For details, see
![](figures/en-us_image_0000001148858818.png)
Before the installation, you must configure an application signature. For details, see [Configuring the OpenHarmony App Signature](../quick-start/configuring-openharmony-app-signature.md). After the installation is complete, click the **Run** icon on the screen to open the application. **Hello World** is displayed in the center of the screen.
Before the installation, you must configure an application signature. For details, see [Configuring the OpenHarmony App Signature](https://developer.harmonyos.com/en/docs/documentation/doc-guides/ohos-debugging-and-running-0000001263040487#section17660437768). After the installation is complete, click the **Run** icon on the screen to open the application. **Hello World** is displayed in the center of the screen.
![](figures/en-us_image_0000001158896538.png)
......@@ -2,17 +2,8 @@
- [Application Development Overview](application-dev-guide.md)
- Quick Start
- [Getting Started with Application Development](quick-start/Readme-EN.md)
- DevEco Studio (OpenHarmony) User Guide
- [Overview](quick-start/deveco-studio-overview.md)
- [Version Change History](quick-start/deveco-studio-release-notes.md)
- [Configuring the OpenHarmony SDK](quick-start/configuring-openharmony-sdk.md)
- [Creating an OpenHarmony Project](quick-start/create-openharmony-project.md)
- [Using the Project Wizard to Create a Project](quick-start/use-wizard-to-create-project.md)
- [Importing a Sample to Create a Project](quick-start/import-sample-to-create-project.md)
- [Configuring the OpenHarmony App Signature](quick-start/configuring-openharmony-app-signature.md)
- [Installing and Running Your OpenHarmony App](quick-start/installing-openharmony-app.md)
- [Directory Structure](quick-start/package-structure.md)
- [Resource File Categories](quick-start/basic-resource-file-categories.md)
- Development
- UI
- JavaScript-based Web-Like Development Paradigm
......@@ -175,13 +166,7 @@
- [Overview of Application Event Logging](dfx/hiappevent-overview.md)
- [Development Guidelines on Application Event Logging](dfx/hiappevent-guidelines.md)
- Tools
- DevEco Studio (OpenHarmony) User Guide
- [Overview](quick-start/deveco-studio-overview.md)
- [Version Change History](quick-start/deveco-studio-release-notes.md)
- [Configuring the OpenHarmony SDK](quick-start/configuring-openharmony-sdk.md)
- [Creating an OpenHarmony Project](quick-start/create-openharmony-project.md)
- [Configuring the OpenHarmony App Signature](quick-start/configuring-openharmony-app-signature.md)
- [Installing and Running Your OpenHarmony App](quick-start/installing-openharmony-app.md)
- [DevEco Studio (OpenHarmony) User Guide](quick-start/deveco-studio-user-guide-for-openharmony.md)
- Hands-On Tutorials
- [Samples](https://gitee.com/openharmony/app_samples/blob/master/README.md)
- API References
......
......@@ -39,7 +39,7 @@
### 工具
DevEco Studio工具是OpenHarmony应用开发的推荐IDE工具。
[工具](quick-start/deveco-studio-user-guide-for-openharmony.md)部分,讲解了DevEco Studio工具的详细用法,包括使用该工具进行工程创建、应用签名、应用调试、应用安装运行的指导。
[工具](https://developer.harmonyos.com/cn/docs/documentation/doc-guides/ohos-deveco-studio-overview-0000001263280421)部分,讲解了DevEco Studio工具的详细用法,包括使用该工具进行工程创建、应用签名、应用调试、应用安装运行的指导。
### 示例教程
......
- [应用开发导读](application-dev-guide.md)
- 快速开始
- 应用开发快速入门
- DevEco Studio(OpenHarmony)使用指南
- [概述](quick-start/deveco-studio-overview.md)
- [版本变更说明](quick-start/deveco-studio-release-notes.md)
- [配置OpenHarmony SDK](quick-start/configuring-openharmony-sdk.md)
- 创建OpenHarmony工程
- [使用工程向导创建新工程](quick-start/use-wizard-to-create-project.md)
- [通过导入Sample方式创建新工程](quick-start/import-sample-to-create-project.md)
- [配置OpenHarmony应用签名信息](quick-start/configuring-openharmony-app-signature.md)
- [安装运行OpenHarmony应用](quick-start/installing-openharmony-app.md)
- 快速入门
- [前言](quick-start/start-overview.md)
- [使用eTS语言开发](quick-start/start-with-ets.md)
- [使用JS语言开发(传统代码方式)](quick-start/start-with-js.md)
- [使用JS语言开发(低代码方式)](quick-start/start-with-js-low-code.md)
- [应用开发包结构说明](quick-start/package-structure.md)
- [资源文件的分类](quick-start/basic-resource-file-categories.md)
- 快速入门
- [前言](quick-start/start-overview.md)
- [使用eTS语言开发](quick-start/start-with-ets.md)
- [使用JS语言开发(传统代码方式)](quick-start/start-with-js.md)
- [使用JS语言开发(低代码方式)](quick-start/start-with-js-low-code.md)
- 开发基础知识
- [应用开发包结构说明](quick-start/package-structure.md)
- [资源文件的分类](quick-start/basic-resource-file-categories.md)
- 开发
- [Ability开发](ability/Readme-CN.md)
- [Ability框架概述](ability/ability-brief.md)
......@@ -264,17 +259,14 @@
- [国际化开发概述](internationalization/international-overview.md)
- [Intl开发指导](internationalization/intl-guidelines.md)
- [I18n开发指导](internationalization/i18n-guidelines.md)
- 工具
- DevEco Studio(OpenHarmony)使用指南
- [概述](quick-start/deveco-studio-overview.md)
- [版本变更说明](quick-start/deveco-studio-release-notes.md)
- [配置OpenHarmony SDK](quick-start/configuring-openharmony-sdk.md)
- [创建OpenHarmony工程](quick-start/create-openharmony-project.md)
- [配置OpenHarmony应用签名信息](quick-start/configuring-openharmony-app-signature.md)
- [安装运行OpenHarmony应用](quick-start/installing-openharmony-app.md)
- [DevEco Studio(OpenHarmony)使用指南](quick-start/deveco-studio-user-guide-for-openharmony.md)
- 示例教程
- [示例代码](https://gitee.com/openharmony/app_samples/blob/master/README_zh.md)
- [Codelabs](https://gitee.com/openharmony/codelabs/blob/master/README.md)
- API参考
- 组件参考(基于JS扩展的类Web开发范式)
- 组件
......@@ -507,8 +499,6 @@
- [矩阵变换](reference/arkui-ts/ts-matrix-transformation.md)
- [插值计算](reference/arkui-ts/ts-interpolation-calculation.md)
- 全局UI方法
- [图片缓存](reference/arkui-ts/ts-methods-image-cache.md)
- [媒体查询](reference/arkui-ts/ts-methods-media-query.md)
- 弹窗
- [警告弹窗](reference/arkui-ts/ts-methods-alert-dialog-box.md)
- [列表选择弹窗](reference/arkui-ts/ts-methods-action-sheet.md)
......@@ -595,13 +585,13 @@
- [位置服务](reference/apis/js-apis-geolocation.md)
- 基本功能
- [应用上下文](reference/apis/js-apis-system-app.md)
- [日志打印](reference/apis/js-apis-basic-features-logs.md)
- [日志打印](reference/apis/js-apis-logs.md)
- [页面路由](reference/apis/js-apis-system-router.md)
- [弹窗](reference/apis/js-apis-system-prompt.md)
- [应用配置](reference/apis/js-apis-system-configuration.md)
- [定时器](reference/apis/js-apis-basic-features-timer.md)
- [定时器](reference/apis/js-apis-timer.md)
- [设置系统时间](reference/apis/js-apis-system-time.md)
- [动画](reference/apis/js-apis-basic-features-animator.md)
- [动画](reference/apis/js-apis-animator.md)
- [WebGL](reference/apis/js-apis-webgl.md)
- [WebGL2](reference/apis/js-apis-webgl2.md)
- [屏幕截图](reference/apis/js-apis-screenshot.md)
......
# 入门
- DevEco Studio(OpenHarmony)使用指南
- [概述](deveco-studio-overview.md)
- [版本变更说明](deveco-studio-release-notes.md)
- [配置OpenHarmony SDK](configuring-openharmony-sdk.md)
- 创建OpenHarmony工程
- [使用工程向导创建新工程](use-wizard-to-create-project.md)
- [通过导入Sample方式创建新工程](import-sample-to-create-project.md)
- [配置OpenHarmony应用签名信息](configuring-openharmony-app-signature.md)
- [安装运行OpenHarmony应用](installing-openharmony-app.md)
- 快速入门
- [前言](start-overview.md)
- [使用eTS语言开发](start-with-ets.md)
- [使用JS语言开发(传统代码方式)](start-with-js.md)
- [使用JS语言开发(低代码方式)](start-with-js-low-code.md)
- [包结构说明](package-structure.md)
- [资源文件的分类](basic-resource-file-categories.md)
- 开发基础知识
- [包结构说明](package-structure.md)
- [资源文件的分类](basic-resource-file-categories.md)
# 配置OpenHarmony应用签名信息
使用真机设备运行和调试OpenHarmony应用前,需要对应用进行签名才能正常运行。该指导用于OpenHarmony应用的签名配置。除此章节以外,DevEco Studio的其余操作指导无差别,具体请访问[HUAWEI DevEco Studio使用指南](https://developer.harmonyos.com/cn/docs/documentation/doc-guides/tools_overview-0000001053582387)。配置应用签名信息的流程如下图所示。
![zh-cn_image_0000001113808114](figures/zh-cn_image_0000001113808114.png)
## 生成密钥和证书请求文件
OpenHarmony应用通过数字证书(.cer文件)和Profile文件(.p7b文件)来保证应用的完整性,需要通过DevEco Studio来生成密钥文件(.p12文件)和证书请求文件(.csr文件)。同时,也可以使用命令行工具的方式来生成密钥文件和证书请求文件。
### 使用DevEco Studio生成
1. 在主菜单栏点击**Build &gt; Generate Keyand CSR**
> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:**
> 如果本地已有对应的密钥,无需新生成密钥,可以在**Generate Key**界面中点击下方的Skip跳过密钥生成过程,直接使用已有密钥生成证书请求文件。
2.**Key Store File**中,可以点击**Choose Existing**选择已有的密钥库文件(存储有密钥的.p12文件);如果没有密钥库文件,点击**New**进行创建。下面以新创建密钥库文件为例进行说明。
![zh-cn_image_0000001119560738](figures/zh-cn_image_0000001119560738.png)
3.**Create Key Store**窗口中,填写密钥库信息后,点击**OK**
- **Key Store File**:选择密钥库文件存储路径。
- **Password**:设置密钥库密码,必须由大写字母、小写字母、数字和特殊符号中的两种以上字符的组合,长度至少为8位。请记住该密码,后续签名配置需要使用。
- **Confirm Password**:再次输入密钥库密码。
![zh-cn_image_0000001152674854](figures/zh-cn_image_0000001152674854.png)
4.**Generate Key**界面中,继续填写密钥信息后,点击**Next**
- **Alias**:密钥的别名信息,用于标识密钥名称。请记住该别名,后续签名配置需要使用。
- **Password**:密钥对应的密码,与密钥库密码保持一致,无需手动输入。
- **Validity**:证书有效期,建议设置为25年及以上,覆盖应用/服务的完整生命周期。
- **Certificate**:输入证书基本信息,如组织、城市或地区、国家码等。
![zh-cn_image_0000001117639668](figures/zh-cn_image_0000001117639668.png)
5.**Generate CSR**界面,选择密钥和设置CSR文件存储路径。
![zh-cn_image_0000001117479776](figures/zh-cn_image_0000001117479776.png)
6. 点击**OK**按钮,创建CSR文件成功,可以在存储路径下获取生成的密钥库文件(.p12)和证书请求文件(.csr)。
![zh-cn_image_0000001163839541](figures/zh-cn_image_0000001163839541.png)
### 使用命令行工具生成
使用Open JDK携带的Keytool工具生成证书请求文件。
1. 使用管理员身份运行命令行工具。
![zh-cn_image_0000001248045243](figures/zh-cn_image_0000001248045243.png)
2. 切换到keytool工具所在路径,实际路径请根据安装目录进行修改。
![zh-cn_image_0000001247125297](figures/zh-cn_image_0000001247125297.png)
3. 执行如下命令,生成公私钥文件。例如,生成的密钥库名称为ide_demo_app.p12,存储到D盘根目录下。
```
keytool -genkeypair -alias "ide_demo_app" -keyalg EC -sigalg SHA256withECDSA -dname "C=CN,O=Organization,OU=Unit,CN=ide_demo_app" -keystore d:\\idedemokey.p12 -storetype pkcs12 -validity 9125 -storepass 123456Abc -keypass 123456Abc
```
生成公私钥文件的参数说明如下:
> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:**
> 请记录**下alias、storepass**和**keypass**的值,在后续[配置应用签名信息](#配置应用签名信息)操作会使用到。
- **alias**:密钥的别名信息,用于标识密钥名称。
- **sigalg**:签名算法,固定为**SHA256withECDSA**
- **dname**:按照操作界面提示进行输入。
- C:国家/地区代码,如CN。
- O:组织名称,如Organization。
- OU:组织单位名称,如Unit。
- CN:名字与姓氏,建议与别名一致。
- **validity**:证书有效期,建议设置为9125(25年)。
- **storepass**:设置密钥库密码,必须由大写字母、小写字母、数字和特殊符号中的两种以上字符的组合,长度至少为8位。请记住该密码,后续签名配置需要使用。
- **keypass**:设置密钥的密码,请与**storepass**保持一致。
4. 执行如下命令,执行后需要输入**storepass**密码,生成证书请求文件,后缀格式为.csr。
```
keytool -certreq -alias "ide_demo_app" -keystore d:\\idedemokey.p12 -storetype pkcs12 -file d:\\idedemokey.csr
```
生成证书请求文件的参数说明如下:
- **alias**:与3中输入的alias保持一致。
- **file**:生成的证书请求文件名称,后缀为.csr。
## 生成应用证书文件
使用[生成密钥和证书请求文件](#生成密钥和证书请求文件)中生成的证书请求文件,来生成应用签名所需的数字证书文件。生成方法如下:
进入DevEco Studio安装目录的**Sdk\toolchains\lib**文件夹下(该SDK目录只能是OpenHarmony SDK,配置方法可参考[配置OpenHarmony SDK](../quick-start/configuring-openharmony-sdk.md)),打开命令行工具,执行如下命令(如果keytool命令不能执行,请在系统环境变量中添加JDK的环境变量)。其中,只需要修改输入和输出即可快速生成证书文件,即修改**-infile**指定证书请求文件csr文件路径,**-outfile**指定输出证书文件名及路径。
```
keytool -gencert -alias "OpenHarmony Application CA" -infile myApplication_ohos.csr -outfile myApplication_ohos.cer -keystore OpenHarmony.p12 -sigalg SHA384withECDSA -storepass 123456 -ext KeyUsage:"critical=digitalSignature" -validity 3650 -rfc
```
关于该命令的参数说明如下:
- **alias**:用于签发证书的CA私钥别名,OpenHarmony社区CA私钥存于OpenHarmony.p12密钥库文件中,该参数不能修改。
- **infile**:证书请求(CSR)文件的路径。
- **outfile**:输出证书链文件名及路径。
- **keystore**:签发证书的CA密钥库路径,OpenHarmony密钥库文件名为OpenHarmony.p12,文件在OpenHarmony SDK中**Sdk\toolchains\lib**路径下,该参数不能修改。请注意,该OpenHarmony.p12文件并不是[生成密钥和证书请求文件](#生成密钥和证书请求文件)中生成的.p12文件。
- **sigalg**:证书签名算法,该参数不能修改。
- **storepass**:密钥库密码,密码为123456,该参数不能修改。
- **ext**:证书扩展项,该参数不能修改。
- **validity**:证书有效期,自定义天数。
- **rfc**:输出文件格式指定,该参数不能修改。
## 生成应用Profile文件
Profile文件包含OpenHarmony应用的包名、数字证书信息、描述应用允许申请的证书权限列表,以及允许应用调试的设备列表(如果应用类型为Release类型,则设备列表为空)等内容,每个应用包中均必须包含一个Profile文件。
进入**Sdk\toolchains\lib**目录下,打开命令行工具,执行如下命令。
```
java -jar provisionsigtool.jar sign --in UnsgnedReleasedProfileTemplate.json --out myApplication_ohos_Provision.p7b --keystore OpenHarmony.p12 --storepass 123456 --alias "OpenHarmony Application Profile Release" --sigAlg SHA256withECDSA --cert OpenHarmonyProfileRelease.pem --validity 365 --developer-id ohosdeveloper --bundle-name 包名 --permission 受限权限名(可选) --permission 受限权限名(可选) --distribution-certificate myApplication_ohos.cer
```
关于该命令的参数说明如下:
- **provisionsigtool**:Profile文件生成工具,文件在OpenHarmony SDK的**Sdk\toolchains\lib**路径下。
- **in**:Profile模板文件所在路径,文件在OpenHarmony SDK中**Sdk\toolchains\lib**路径下,该参数不能修改。
- **out**:输出的Profile文件名和路径。
- **keystore**:签发证书的密钥库路径,OpenHarmony密钥库文件名为OpenHarmony.p12,文件在OpenHarmony SDK中**Sdk\toolchains\lib**路径下,该参数不能修改。
- **storepass**:密钥库密码,密码为123456,该参数不能修改。
- **alias**:用于签名Profile私钥别名,OpenHarmony社区CA私钥存于OpenHarmony.p12密钥库文件中,该参数不能修改。
- **sigalg**:证书签名算法,该参数不能修改。
- **cert**:签名Profile的证书文件路径,文件在OpenHarmony SDK中**Sdk\toolchains\lib**路径下,该参数不能修改。
- **validity**:证书有效期,自定义天数。
- **developer-id**:开发者标识符,自定义一个字符串。
- **bundle-name**:填写应用包名。
- **permission**:可选字段,如果不需要,则可以不用填写此字段;如果需要添加多个受限权限,则如示例所示重复输入。受限权限列表如下:ohos.permission.READ_CONTACTS、ohos.permission.WRITE_CONTACTS。
- **distribution-certificate**[生成应用证书文件](#生成应用证书文件)中生成的证书文件。
## 配置应用签名信息
在真机设备上调试前,需要使用到制作的私钥(.p12)文件、证书(.cer)文件和Profile(.p7b)文件对调试的模块进行签名。
打开**File &gt; Project Structure**,点击**Project &gt; Signing Configs &gt; debug**窗口中,去除勾选“Automatically generate signing”,然后配置指定模块的调试签名信息。
- **Store File**:选择密钥库文件,文件后缀为.p12,该文件为[生成密钥和证书请求文件](#生成密钥和证书请求文件)中生成的.p12文件。
- **Store Password**:输入密钥库密码,该密码为[生成密钥和证书请求文件](#生成密钥和证书请求文件)中填写的密钥库密码保持一致。
- **Key Alias**:输入密钥的别名信息,与[生成密钥和证书请求文件](#生成密钥和证书请求文件)中填写的别名保持一致。
- **Key Password**:输入密钥的密码,与**Store Password**保持一致。
- **Sign Alg**:签名算法,固定为SHA256withECDSA。
- **Profile File**:选择[生成应用Profile文件](#生成应用profile文件)中生成的Profile文件,文件后缀为.p7b。
- **Certpath File**:选择[生成应用证书文件](#生成应用证书文件)中生成的数字证书文件,文件后缀为.cer。
![zh-cn_image_0000001155643492](figures/zh-cn_image_0000001155643492.png)
设置完签名信息后,点击**OK**进行保存,然后可以在工程下的build.gradle中查看签名的配置信息。
![zh-cn_image_0000001202722349](figures/zh-cn_image_0000001202722349.png)
默认情况下,DevEco Studio编译hap包的类型为debug类型,如果需要编译release类型的hap包,请打开工程左下角的OhosBuild Variants,设置模块的编译构建类型为release。关于编译构建hap的详细说明请参考[HUAWEI DevEco Studio使用指南](https://developer.harmonyos.com/cn/docs/documentation/doc-guides/build_hap-0000001053342418)
![zh-cn_image_0000001115066116](figures/zh-cn_image_0000001115066116.png)
编译完成后,OpenHarmony应用的Hap包可以从工程的bulid目录下获取。
![zh-cn_image_0000001163918627](figures/zh-cn_image_0000001163918627.png)
# 配置OpenHarmony SDK
在设置OpenHarmony应用开发环境时,需要开发者在DevEco Studio中配置对应的SDK信息。
> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:**
> 请注意,OpenHarmony SDK版本精简了部分工具链,因此不适用于HarmonyOS应用开发。
## 前提条件
已下载并安装好DevEco Studio 3.0 Beta1及以上版本,点击[链接下载](https://developer.harmonyos.com/cn/develop/deveco-studio#download)
## 配置SDK信息
DevEco Studio通过SDK Manager统一管理SDK及工具链,OpenHarmony包含如下SDK包:
| 类别 | 包名 | 说明 |
| -------- | -------- | -------- |
| SDK | JS | JS语言SDK包。 |
| eTS | eTS(Extended&nbsp;TypeScript)&nbsp;SDK包。 |
| SDK&nbsp;Tool | Toolchains | SDK工具链,OpenHarmony应用开发必备工具集,包括编译、打包、签名、数据库管理等工具的集合。 |
| Previewer | OpenHarmony应用预览器,可以在应用开发过程中查看界面UI布局效果。 |
1. 运行已安装的DevEco Studio,首次使用,请选择**Do not import settings**,点击OK。
2. 进入配置向导页面,设置**npm registry**,DevEco Studio已预置对应的仓,直接点击**Start using DevEco Studio**进入下一步。
> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:**
> 如果配置向导界面出现的是设置**Set up HTTP Proxy**界面,说明网络受限,请根据[参考信息](#参考信息)配置DevEco Studio代理、NPM代理和Gradle代理后,再下载OpenHarmony SDK。
![zh-cn_image_0000001163314102](figures/zh-cn_image_0000001163314102.png)
3. DevEco Studio向导指引开发者下载SDK,默认下载OpenHarmony SDK。SDK下载到user目录下,也可以指定对应的存储路径,SDK存储路径不支持中文字符,然后点击**Next**
![zh-cn_image_0000001208394019](figures/zh-cn_image_0000001208394019.png)
> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:**
> 如果不是首次安装DevEco Studio,可能无法查看进入该界面,可通过欢迎页的**Configure (或**![zh-cn_image_0000001208274069](figures/zh-cn_image_0000001208274069.png)**图标)&gt; Settings &gt; SDK Manager &gt; OpenHarmony SDK**界面,点击**OpenHarmony SDK Location**加载SDK。
4. 在弹出的SDK下载信息页面,点击**Next**,并在弹出的**License Agreement**窗口,点击**Accept**开始下载SDK。
![zh-cn_image_0000001163472654](figures/zh-cn_image_0000001163472654.png)
5. 等待OpenHarmony SDK及工具下载完成,点击**Finish**,界面会进入到DevEco Studio欢迎页。
![zh-cn_image_0000001163632602](figures/zh-cn_image_0000001163632602.png)
## 参考信息
DevEco Studio开发环境需要依赖于网络环境,需要连接上网络才能确保工具的正常使用。
一般来说,如果使用的是个人或家庭网络,是不需要设置代理信息的;只有部分企业网络受限的情况下,才需要设置代理信息。
如果是第一次打开DevEco Studio,配置向导界面出现设置**Set up HTTP Proxy**界面,说明网络受限,可以通过配置代理的方式来解决,需要配置DevEco Studio代理、NPM代理和Gradle代理。
![zh-cn_image_0000001166582138](figures/zh-cn_image_0000001166582138.png)
### 配置DevEco Studio代理
1. 启动DevEco Studio,配置向导进入**Set up HTTP Proxy**界面,勾选**Manual proxy configuration**,设置DevEco Studio的HTTP Proxy。
> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:**
> 如果非首次设置向导进入HTTP Proxy,可以通过如下方式进入HTTP Proxy配置界面:
>
> - 在欢迎页点击**Configure(或**![zh-cn_image_0000001212142015](figures/zh-cn_image_0000001212142015.png)**图标) &gt; Settings &gt; Appearance &amp; Behavior &gt; System Settings &gt; HTTP Proxy**进入HTTP Proxy设置界面(Mac系统为**Configure &gt; Preferences &gt; Appearance &amp; Behavior &gt; System Settings &gt; HTTP Proxy**)。
>
> - 在打开了工程的情况下,可以点击**File &gt; Settings &gt; Appearance &amp; Behavior &gt; System Settings &gt; HTTP Proxy**进入HTTP Proxy设置界面(Mac系统为**DevEco Studio &gt; Preferences &gt; Appearance &amp; Behavior &gt; System Settings &gt; HTTP Proxy**)
- **HTTP**配置项,设置代理服务器信息。**如果不清楚代理服务器信息,可以咨询你们的网络管理人员**
- **Host name**:代理服务器主机名或IP地址。
- **Port number**:代理服务器对应的端口号。
- **No proxy for**:不需要通过代理服务器访问的URL或者IP地址(地址之间用英文逗号分隔)。
- **Proxy authentication**配置项,如果代理服务器需要通过认证鉴权才能访问,则需要设置。否则,请跳过该配置项。
- **Login**:访问代理服务器的用户名。
- **Password**:访问代理服务器的密码。
- **Remember**:勾选,记住密码。
![zh-cn_image_0000001212062065](figures/zh-cn_image_0000001212062065.png)
2. 配置完成后,点击**Check connection**,输入网络地址(如:https://developer.harmonyos.com),检查网络连通性。提示Connection successful表示代理设置成功。
3. 点击**Next: Configure npm**继续设置NPM代理信息,请参考[配置NPM代理](#配置npm代理)
### 配置NPM代理
通过DevEco Studio的设置向导设置NPM代理信息,代理信息将写入用户“users/用户名/”目录下的**.npmrc**文件。
> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:**
> 该向导只有第一次安装DevEco Studio才会出现。如果未出现该向导,可以直接在“users/用户名/”目录下的**.npmrc**文件中,添加代理配置信息。
- npm registry:设置npm仓的地址信息,建议勾选。
- HTTP proxy:代理服务器信息,默认会与DevEco Studio的HTTP proxy设置项保持一致。
- Enable Https Proxy:同步设置HTTPS Proxy配置信息,建议勾选。
![zh-cn_image_0000001164577336](figures/zh-cn_image_0000001164577336.png)
然后点击**Start using DevEco Studio**继续下一步操作。
如果代理服务器需要认证(需要用户名和密码),请先根据如下指导配置代理服务器的用户名和密码信息,然后再下载OpenHarmony SDK;否则,请跳过该操作,参考[配置SDK信息](#配置sdk信息)进行操作即可。
![zh-cn_image_0000001209817299](figures/zh-cn_image_0000001209817299.png)
1. 进入用户的users目录,打开**.npmrc**文件。
2. 修改npm代理信息,在proxy和https-proxy中,增加user和password字段,具体取值请以实际代理信息为准。示例如下所示:
```
proxy=http://user:password@proxy.server.com:80
https-proxy=http://user:password@proxy.server.com:80
```
> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:**
> 如果password中存在特殊字符,如\@、\#、\*等符号,可能导致配置不生效,建议将特殊字符替换为ASCII码,并在ASCII码前加百分号%。常用符号替换为ASCII码对照表如下:
>
> - !:%21
>
> - \@:%40
>
> - \#:%23
>
> - ¥:%24
>
> - &amp;:%26
>
> - \*:%2A
3. 代理设置完成后,打开命令行工具,执行如下命令进行验证网络是否正常。
```
npm info express
```
执行结果如下图所示,则说明代理设置成功。
![zh-cn_image_0000001164417356](figures/zh-cn_image_0000001164417356.png)
4. 网络设置完成后,然后再[配置SDK信息](#配置sdk信息)
### 设置Gradle代理
1. 打开“此电脑”,在文件夹地址栏中输入**%userprofile%**(Mac系统请点击**前往 &gt; 个人**),进入个人用户文件夹。
![zh-cn_image_0000001166740700](figures/zh-cn_image_0000001166740700.png)
2. 创建一个文件夹,命名为**.gradle**。如果已有.gradle文件夹,请跳过此操作。
> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:**
> macOS系统创建.gradle文件夹前,请将系统设置为“显示隐藏文件”。
3. 进入.gradle文件夹,新建一个文本文档,命名为**gradle**,并修改后缀为**.properties**
4. 打开**gradle.properties**文件中,添加如下脚本,然后保存。
其中代理服务器、端口、用户名、密码和不使用代理的域名,请根据实际代理情况进行修改。其中不使用代理的nonProxyHosts的配置间隔符是 “|”。
```
systemProp.http.proxyHost=proxy.server.com
systemProp.http.proxyPort=8080
systemProp.http.nonProxyHosts=*.company.com|10.*|100.*
systemProp.http.proxyUser=userId
systemProp.http.proxyPassword=password
systemProp.https.proxyHost=proxy.server.com
systemProp.https.proxyPort=8080
systemProp.https.nonProxyHosts=*.company.com|10.*|100.*
systemProp.https.proxyUser=userId
systemProp.https.proxyPassword=password
```
# 创建OpenHarmony工程
- **[使用工程向导创建新工程](use-wizard-to-create-project.md)**
- **[通过导入Sample方式创建新工程](import-sample-to-create-project.md)**
\ No newline at end of file
# 概述
## 总体说明
DevEco Studio是HarmonyOS的配套的开发IDE,因为HarmonyOS是基于OpenHarmony开发的,因此,使用DevEco Studio(配套HarmonyOS)也可以进行OpenHarmony的应用开发。
使用DevEco Studio开发OpenHarmony应用的流程与开发HarmonyOS的流程完全一样,本文档仅描述OpenHarmony应用开发与HarmonyOS应用开发的差异点。
- **搭建开发环境差异**:OpenHarmony应用开发环境需要先安装OpenHarmony SDK,具体可参考[配置OpenHarmony SDK](../quick-start/configuring-openharmony-sdk.md)章节。
- **创建OpenHarmony工程**:OpenHarmony应用开发,可以通过工程向导创建一个新工程,或通过导入Sample工程的方式来创建一个新工程,具体可参考[使用工程向导创建新工程](../quick-start/use-wizard-to-create-project.md)
- **调试签名配置**:OpenHarmony应用运行在真机设备上,需要对应用进行签名,关于OpenHarmony应用的签名指导请参考[配置OpenHarmony应用签名信息](../quick-start/configuring-openharmony-app-signature.md)
- **在真机设备上运行应用**:将OpenHarmony的hap包推送到真机设备上进行安装,具体可参考[安装运行OpenHarmony应用](../quick-start/installing-openharmony-app.md)
关于DevEco Studio的详细操作指导,请访问[HUAWEI DevEco Studio使用指南](https://developer.harmonyos.com/cn/docs/documentation/doc-guides/tools_overview-0000001053582387)
## 使用约束
- OpenHarmony只支持使用eTS、JS语言开发应用,不支持Java、C/C++语言。
- OpenHarmony开发环境DevEco Studio暂只支持Windows系统。
OpenHarmony与HarmonyOS的开发工具都是DevEco Studio,下表为OpenHarmony相比HarmonyOS不支持的功能说明:
| 特性名称 | HarmonyOS版本 | OpenHarmony版本 |
| -------- | -------- | -------- |
| 服务卡片 | **√** | **X** |
| 自动化签名 | **√** | **X** |
| 远程模拟器 | **√** | **X** |
| 本地模拟器 | **√** | **X** |
| 使用DevEco&nbsp;Studio进行日志查看、调优 | **√** | **X** |
| 云测试 | **√** | **X** |
| 安全测试 | **√** | **X** |
## DevEco Studio演进路标
Huawei DevEco Studio分阶段支持OpenHarmony应用开发的演进路标如下:
![zh-cn_image_0000001210018359](figures/zh-cn_image_0000001210018359.png)
# 版本变更说明
## V3.0 Beta2(2021-12-31)
### 版本兼容性
DevEco Studio 3.0 Beta2版本兼容性配套关系如下表所示。
| 组件 | 版本要求 | 说明 |
| -------- | -------- | -------- |
| Gradle | 7.3(最低版本要求7.2) | DevEco&nbsp;Studio已自带了Gradle7.3版本,开发者无需单独安装。 |
| JDK | 11.0.x | DevEco&nbsp;Studio已自带了JDK&nbsp;11版本,开发者无需单独安装。 |
| OpenHarmony&nbsp;SDK | 3.1.0.0(API&nbsp;Version&nbsp;8&nbsp;Beta) | 兼容历史版本SDK。 |
| Toolchinas | 3.1.0.0 | 建议更新至最新版本。 |
| hap插件 | 3.0.5.2 | 建议更新至最新版本。 |
| decctest插件 | 1.2.7.2 | 建议更新至最新版本。 |
### 版本变更说明
| |
| -------- |
| **新增特性:**<br/>-&nbsp;新增DevEco&nbsp;Studio支持界面功能菜单的汉化版本,默认显示为英文,如需开启汉化版本,请打开DevEco&nbsp;Studio的**Settings**界面,在**Plugins&nbsp;&gt;&nbsp;installed**中手动勾选“Chinese(Simplified)”插件,然后重新启动DevEco&nbsp;Studio即可生效。<br/>-&nbsp;新增支持OpenHarmony应用或服务的调试和运行,支持断点管理、变量查看、Step&nbsp;Into\Step&nbsp;Over\Step&nbsp;Out等单步调试功能。<br/>**增强特性:**<br/>-&nbsp;OpenHarmony&nbsp;SDK更新至3.1.0.0版本(API&nbsp;Version&nbsp;8&nbsp;Beta),配套的hap编译构建插件版本更新至3.0.5.2。<br/>-&nbsp;工程模板新增支持低代码开发的[Standard]Empty&nbsp;Ability模板。<br/>-&nbsp;支持eTS组件预览,要求compileSdkVersion为8或以上。<br/>-&nbsp;eTS实时预览支持边修改属性边展示预览效果,无需保存修改才生效,要求compileSdkVersion为8或以上。 |
## V3.0 Beta1(2021-09-29)
| |
| -------- |
| **新增特性:**<br/>-&nbsp;新增支持OpenHarmony&nbsp;SDK的管理,开发者可通过DevEco&nbsp;Studio的SDK&nbsp;Manager功能来下载和管理OpenHarmony&nbsp;SDK。<br/>-&nbsp;在编译构建HAP包时,新增支持对单个Module进行编译,对于多Module工程中只需要编译其中一个Module的场景,可以提升编译构建速度;同时还新增支持一键重构建HAP包,即在编译构建HAP前,会自动执行Clean&nbsp;Project操作。<br/>**增强特性:**<br/>-&nbsp;编译构建插件更新至3.0.3.2版本。<br/>-&nbsp;Json编辑器增强,资源索引错误支持快速修复,并支持快速查看资源的取值。<br/>-&nbsp;工程视图支持Ohos视图,默认视图为Project视图,开发者可手动切换。<br/>-&nbsp;OpenHarmony工程支持ark方舟编译。<br/>-&nbsp;OpenHarmony工程类型标识字段supportSystem&nbsp;"standard",由模块级build.gradle调整至工程级build.gradle。 |
......@@ -2,14 +2,19 @@
- **[概述](deveco-studio-overview.md)**
HUAWEI DevEco Studio For OpenHarmony(以下简称DevEco Studio)是基于IntelliJ IDEA Community开源版本打造,面向OpenHarmony全场景多设备的一站式集成开发环境(IDE),为开发者提供工程模板创建、开发、编译、调试、发布等E2E的OpenHarmony应用/服务开发。
- **[版本变更说明](deveco-studio-release-notes.md)**
DevEco Studio 3.0 Beta3(于2022-3-30日发布)作为支撑Openharmony应用和服务开发的IDE,具有以下能力特点:
- **[配置OpenHarmony SDK](configuring-openharmony-sdk.md)**
- 支持一站式的信息获取平台
- 提供多设备工程模板
- 高效的代码编辑
- 支持可视化的界面UI开发
- 双向、极速的界面UI预览
- 全新的编译工具Hvigor
- 支持基于设备系统能力集Syscap进行应用开发
- 支持全自动化的应用签名机制
- 丰富的代码调试调优能力
- **[创建OpenHarmony工程](create-openharmony-project.md)**
更多工具体验和使用指导请见:[DevEco Studio (OpenHarmony) 使用指南](https://developer.harmonyos.com/cn/docs/documentation/doc-guides/ohos-deveco-studio-overview-0000001263280421)
- **[配置OpenHarmony应用签名信息](configuring-openharmony-app-signature.md)**
- **[安装运行OpenHarmony应用](installing-openharmony-app.md)**
\ No newline at end of file
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册