DevEco Studio supports the development of Harmony Shared Packages (HSPs). They are designed to allow for dynamic, on-demand downloading of functionalities for apps/atomic services, and loading of required packages for atomic services. When there are multiple installation packages that require resource sharing, HSPs can also be utilized to reduce the repetitive packing of common resources and code.


After the creation is complete, the HSP module and related files are generated in the project directory.

When you have developed the in-app HSP module, select the module name and choose Build > Make Module ${libraryName} on the menu bar to build an HSP.

By default, a HAR is created automatically with an HSP. Therefore, you can find the .har and .hsp files in the build folder of the module directory.

To share an HSP in an app, you must upload the .tgz file for it to a private repository (see Obtaining Third-Party Libraries from ohpm-repo). To generate a .tgz file for an HSP, perform the following:
icon on the toolbar to switch the build mode to release.

After the build is complete, the .tgz file is generated in the build folder. You can then upload it to a private repository for sharing in an app.
