full-sdk-switch-guide.md 4.7 KB
Newer Older
E
ester.zhou 已提交
1
# Switching to Full SDK
E
ester.zhou 已提交
2

3
Both the public SDK and full SDK are toolkits for application development. <br>The public SDK is intended for application developers and provided as standard in DevEco Studio. It does not contain system APIs – APIs required by system applications.
E
ester.zhou 已提交
4 5 6

The full SDK is intended for original equipment manufacturers (OEMs) and provided separately. It contains system APIs.

7
The SDK of API version 8 provided in DevEco Studio is a public SDK. If your project depends on any system API, such as the **animator** component, **XComponent**, or APIs in **@ohos.application.abilityManager.d.ts**, **@ohos.application.formInfo.d.ts**, or **@ohos.bluetooth.d.ts**, switch to the full SDK by performing the following steps.
E
ester.zhou 已提交
8

9 10 11
> **NOTE**
>
> The screenshots in this document are for reference only.
E
ester.zhou 已提交
12

13
## Downloading the Full SDK
E
ester.zhou 已提交
14

15
Manually download the system-specific full SDK package from the mirror. For details, see [Release Notes](../../release-notes/OpenHarmony-v3.2-beta2.md).
E
ester.zhou 已提交
16

17
## Checking the Local SDK Location
E
ester.zhou 已提交
18

19
In this example, an ArkTS project is used. For a JS project, replace **ets** with **js**.
20

E
ester.zhou 已提交
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38

In DevEco Studio, choose **Tools** > **OpenHarmony SDK Manager** to check the location of the local SDK.

![](figures/en-us_image_0000001655128939.png)

![image-20220613160524053](figures/en-us_image_0000001655128998.png)


## Replacing the SDK

1. Make sure the downloaded SDK is a full SDK.

   a. Verify that the name of the downloaded file contains **sdk-full**.

   ![image-20220613220702504](figures/en-us_image_0000001655129232.png)

   b. Verify that the SDK contains system APIs (such as APIs defined in **@ohos.application.abilityManager.d.ts**, **@ohos.application.formInfo.d.ts**, and **@ohos.bluetooth.d.ts**).

39 40 41
   Note: The criteria for identifying system APIs are subject to the official API documentation.

   
E
ester.zhou 已提交
42

43
2. Replace the SDK. The following uses public-SDK-3.x.x.x for Windows as an example.
E
ester.zhou 已提交
44

45 46 47
    

   a. Decompress the downloaded full SDK file: **ets-windows-3.x.x.x-Release.zip**
E
ester.zhou 已提交
48 49 50 51 52

   ![image-20220613165018184](figures/en-us_image_0000001655129264.png)

   b. Replace the SDK files.

53
   Back up the local SDK files. (Copy and rename the version directory in the **ets** directory, or copy the entire **ets** directory to another local path.)
E
ester.zhou 已提交
54 55 56 57 58

   Go to the obtained location of the local installed SDK and back up the files therein.

   ![image-20220613161352157](figures/en-us_image_0000001655129041.png)

59
   Note: The name of the backup version directory must be different from the value of the **version** field in the **oh-uni-package.json** file. In the example below, the name of the backup version directory is **3.1.6.6_backup**.
E
ester.zhou 已提交
60 61 62

   ![image-20220613165018184](figures/en-us_image_0000001655129398.png)

63
   The configuration in the **oh-uni-package.json** file is as follows, where the value of **apiVersion** is subject to the API version of the SDK, and the value of **version** is subject to the version number in the SDK file.
E
ester.zhou 已提交
64

65
   ```json
E
ester.zhou 已提交
66
   {
67
     "apiVersion": "X",
E
ester.zhou 已提交
68 69 70 71 72 73
     "displayName": "Ets",
     "meta": {
       "metaVersion": "3.0.0"
     },
     "path": "ets",
     "releaseType": "Release",
74
     "version": "3.x.x.x"
E
ester.zhou 已提交
75 76
   }
   ```
77
   
E
ester.zhou 已提交
78

79
   **Delete all files in the original SDK (3.x.x.x) directory.** Failure to do so may result in some files being unable to be overwritten.
E
ester.zhou 已提交
80 81 82 83 84

   

   Copy the full SDK to the location of the local SDK.

85
   Copy all files in the **ets** directory in the full SDK to the **ets\3.x.x.x** directory in the location of the local SDK.
E
ester.zhou 已提交
86 87 88 89 90

   Change the value of **version** in the **oh-uni-package.json** file to the current SDK version number.

   

91
   In the ***3.x.x.x*\build-tools\ets-loader** directory, open the **cmd/powerShell** window and run the **npm install** command to download the **node_modules** dependency package.
E
ester.zhou 已提交
92 93 94 95 96 97

   ![image-20220613171111405](figures/en-us_image_0000001655129333.png)

   

   c. Check for system APIs.
98

E
ester.zhou 已提交
99
   ![image-20220613213038104](figures/en-us_image_0000001655129372.png)
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117

## Appendix: macOS Security Alarm Handling

After the SDK is switched to the full SDK in DevEco Studio on macOS, an alarm is generated when the Previewer is opened.

![alarm](figures/alarm.png)

To clear the alarm, perform the following steps:

1. Start the Terminal application.

2. In Terminal, run **sudo spctl -- master - disable**.

3. In **System Preferences**, choose **Security & Privacy**, click the **General** tab and select **Anywhere** under **Allow apps downloaded from**.

![alarmHand](figures/alarmHand.png)

Now, applications downloaded from third-party sources will not be blocked, meaning that you can open the Previewer. For security purposes, change the **Allow apps downloaded from** settings back to the original option when the Previewer is not in use.