Install Deveco studio quickly by hand

Download Deveco Studio

  Step 1 Click the link to download the DevEco Studio installation package.
To download DevEco Studio, you need to log in to the HarmonyOS application developer portal with a Huawei account. At the same time, the use of the DevEco Studio remote simulator requires your Huawei account for real-name authentication. It is recommended that you submit the real-name authentication audit immediately after registering your Huawei account . The audit period is 1 to 3 working days. For details, please refer to Registering a Huawei account.
Step 2 Double-click the downloaded "deveco-studio-xxxx.exe" to enter the DevEco Studio installation wizard, check the DevEco Studio launcher in the following installation options interface, and click Next until the installation is complete.
Insert picture description here

Download and install Node.js

The Node.js software only needs to be installed when you use the JS language to develop HarmonyOS applications. Use other languages ​​to develop without installing Node.js, please skip this chapter.

Step 1 Log in to the official website of Node.js and download the Node.js software package. Please select the LTS version, the software package corresponding to Windows 64 bit, and always install it.

1.1 Configure the development environment

The DevEco Studio development environment needs to depend on your network environment. It needs to be connected to the network to ensure the normal use of the tool. You can configure the development environment according to the following two situations:
l If you can directly access the Internet, you only need to download the HarmonyOS SDK operating.
l If your network cannot directly access the Internet, you need to access it through a proxy server. You need to follow the instructions below (including setting npm proxy, setting Gradle proxy, setting DevEco Studio proxy, and downloading HarmonyOS SDK) to set up the development environment one by one.

Setting up the npm proxy
Only when the following two conditions are met at the same time, you need to configure the npm proxy, otherwise, please skip this chapter.
l You need to use JS language to develop HarmonyOS applications.
l Your network cannot directly access the Internet, but only through a proxy server. In this case, configure the npm proxy to facilitate downloading JS dependencies from the npm server.

Open the command line tool, and perform npm proxy settings and verification as follows.

l Step 1 Execute the following command to set up the npm proxy.
l If the proxy server you are using requires authentication, please set it as follows (please modify user, password, proxyserver and port according to the actual proxy server).

npm config set proxy http://user:password@proxyserver:port 
npm config set https-proxy http://user:password@proxyserver:port

l If the proxy server you are using does not require authentication (no account and password are required), please set it as follows.

npm config set proxy http:proxyserver:port 
npm config set https-proxy http:proxyserver:port

Step 2 After completing the proxy settings, execute the following commands to verify.

npm info express

The execution result is shown in the figure below, indicating that the proxy setting is successful.
Insert picture description here

Set up Gradle proxy

If your network cannot directly access the Internet, it needs to be accessed through a proxy server. In this case, you need to set up a Gradle proxy to access and download the dependencies required by Gradle. Otherwise, please skip this chapter.
  Step 1 Open "this computer" and enter %userprofile% in the folder address bar to enter the personal data interface.
  Step 2 Create a folder, the command is .gradle. If you already have a .gradle folder, please skip this operation.
  Step 3 Enter the .gradle folder, create a new text document, name it gradle, and modify the suffix to .properties.
  Step 4 Open the gradle.properties file, add the following script, and save it.

  The proxy server, port, user name, password, and domain name that does not use the proxy, please modify according to the actual proxy situation. Among them, the configuration interval of "nonProxyHosts" that does not use proxy is "|".

 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

   Step 5 After the Gradle proxy setting is completed, in DevEco Studio, click Gradle on the far right, and click similar cycle in the Gradle tool to re-execute Gradle synchronization.
After successful synchronization, "ProjectName: successful" will appear in the Build tool window.

  ----End

Set up the DevEco Studio proxy

If your network cannot directly access the Internet, but you need to access it through a proxy server. In this case, you need to set up a DevEco Studio proxy to access and download external resources. Otherwise, please skip this chapter.
   Step 1 Run the installed DevEco Studio. For the first use, please select Do not import settings and click OK.
   Step 2 According to the prompt on the DevEco Studio welcome interface, click Setup Proxy.
   Step 3 Set the HTTP Proxy information of DevEco Studio.

l HTTP configuration item, set proxy server information.
l Host name: The host name or IP address of the proxy server.
− Port number: the port number corresponding to the proxy server.
− No proxy for: URLs or IP addresses that do not need to be accessed through a proxy server (the addresses are separated by commas).
l Proxy authentication configuration item, if the proxy server needs to pass the authentication to access, it needs to be set. Otherwise, please skip this configuration item.
− Login: User name for accessing the proxy server.
− Password: Password for accessing the proxy server.
− Remember: Check to remember the password.Insert picture description here

   Step 4 After the configuration is complete, click Check connection, enter the network address (such as: https://developer.harmonyos.com), and check the network connectivity. The prompt "Connection successful" indicates that the proxy setting is successful.
   Step 5 Click the OK button to complete the DevEco Studio proxy configuration.

Download HarmonyOS SDK

DevEco Studio provides SDK Manager for unified management of SDK and toolchain. When downloading SDK packages of various programming languages, SDK Manager will automatically download the toolchains that the SDK packages depend on.
SDK Manager provides SDK packages in multiple programming languages. For the description of each SDK package, please refer to:
l Native: C/C++ language SDK package, which is not automatically downloaded by default, you need to manually check the download. For the corresponding interface documentation, please refer to "Native API Reference".
l JS: JS language SDK package, not automatically downloaded by default, you need to manually check and download. For the corresponding interface documentation, please refer to "JS API Reference".
l Java: Java language SDK package, downloaded by default when the SDK is downloaded for the first time. For the corresponding interface documentation, please refer to "Java API Reference".


Toolchains corresponding to the SDK are also provided: l Toolchains: SDK toolchains, a collection of tools necessary for HarmonyOS application development, including a collection of tools such as compilation, packaging, signing, and database management. The SDK is downloaded by default when downloading the SDK for the first time.
l Previewer: Lite Wearable previewer, you can dynamically preview the interface rendering effect of Lite Wearable application during the development process. It is not automatically downloaded by default, and you need to manually check the download.
When downloading the HarmonyOS SDK for the first time, only the Java SDK and Toolchains will be downloaded by default. Therefore, if you need to use JS or C/C++ language to develop applications, you need to manually download the corresponding SDK package.
  Step 1 Click File> Settings or the default shortcut key Ctrl+Alt+S on the menu bar to open the Settings configuration interface.
  Step 2 Go to Appearance&Behavior> System Settings> HarmonyOS SDK menu interface, click the Edit button, and set the HarmonyOS SDK storage path.
  Step 3 Select the storage path of the HarmonyOS SDK, and then click Next. In the pop-up License Agreement window, click Accept to start downloading the SDK. If you already have an SDK package locally, please select the storage path of the existing SDK package locally. DevEco Studio will update the SDK and toolchain incrementally.
  Step 4 Wait for the download of HarmonyOS SDK and tools to complete, click Finish, you can see that the default Java SDK and toolchains have been downloaded.
  Step 5 If your project will also use JS or C/C++ language, please check the corresponding SDK package in SDK Platform, click Apply, SDK Manager will automatically download the SDK package and tool chain to the settings in step 3. In the SDK storage path.
Insert picture description here

1.2 Run Hello World

After DevEco Studio configures the development environment, you can run the HelloWorld project to verify that the environment settings are correct. Take the Wearable project as an example, run the project in the Wearable remote simulator.
  Step 1 Open DevEco Studio and click Create HarmonyOS Project on the welcome page to create a new project.
  Step 2 Select the device type and template. Take Wearable as an example, select Empty Feature Ability (JS), and click Next.
  Step 3 Fill in the project-related information, keep the default values, and click Finish.
  Step 4 After the project is created, DevEco Studio will automatically synchronize the project, as shown in the figure below.
Insert picture description here
  Step 5 On the DevEco Studio menu bar, click Tools> HVD Manager.
  Step 6 The HUAWEI ID login interface pops up in the browser. Please enter the user name and password of the HUAWEI ID that has been verified by real-name authentication to log in.
  Step 7 After logging in, click the Allow button on the interface to authorize.
  Step 8 In the device list, select the Wearable device and click the button similar to play to run the simulator.
Insert picture description here

  Step 9 Click the button similar to play in the DevEco Studio toolbar to run the project, or use the default shortcut Shift+F10 to run the project.
  Step 10 Select Connected Devices in the Select Deployment Target interface that pops up, and click the OK button.
  Step 11 DevEco Studio will start the compilation of the application. After the compilation is completed, the application can be run on the Remote Device.


Original link: https://developer.huawei.com/consumer/cn/forum/topicview?tid=0202347337194250475&fid=0101303901040230869
Author: kelly

Guess you like

Origin blog.csdn.net/weixin_44708240/article/details/108680753