The HarmonyOS App Pack or the App file, identified with the file extension ".app",
serves as the file format used by the
HarmonyOS
HarmonyOS (HMOS) ( zh, s=鸿蒙, p=Hóngméng, tr=Vast Mist) is a distributed operating system developed by Huawei for smartphones, tablet computer, tablets, smart TVs, smart watches, personal computers and other smart devices. It has a microk ...
operating system. It functions as a native HarmonyOS app for distribution and installation through Huawei AppGallery, or for distribution through Huawei Ability Gallery in respect of installation-free apps under both former classic dual-framework and current HarmonyOS NEXT system of unified OpenHarmony app framework. The App file is also used by a number of other open source HarmonyOS-based operating systems such as OpenHarmony and Oniro-based operating systems for distribution and installation of applications, video games and middleware. Including non OpenHarmony-based operating systems, such as
GNU
GNU ( ) is an extensive collection of free software (394 packages ), which can be used as an operating system or can be used in parts with other operating systems. The use of the completed GNU tools led to the family of operating systems popu ...
Linux
Linux ( ) is a family of open source Unix-like operating systems based on the Linux kernel, an kernel (operating system), operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically package manager, pac ...
-based Unity Operating System that supports the app file format.
Each HarmonyOS app contains one or more HarmonyOS Ability Package (HAP) files with the file extension ".hap", and the
pack.info
file that describes the attributes of the App file.
Most HarmonyOS apps contain at least one HAP file of the entry type, which is the main module of the app, and additional HAP files of the feature type, which is used to implement a specific app feature.
Overview
App Pack and HAP files
HarmonyOS apps are distributed as a software package file known as the App Pack or the App file, suffixed with .app, which is analogous to other software packages such as
apk used by the
Android operating system,
exe
Exe or EXE may refer to:
* .exe, a file extension
* exe., abbreviation for Executive (disambiguation)#Role, title, or function, executive
Places
* River Exe, in England
* Exe Estuary, in England
* Exe Island, in Exeter, England
Transportation a ...
in
Microsoft Windows
Windows is a Product lining, product line of Proprietary software, proprietary graphical user interface, graphical operating systems developed and marketed by Microsoft. It is grouped into families and subfamilies that cater to particular sec ...
, or a
Debian
Debian () is a free and open-source software, free and open source Linux distribution, developed by the Debian Project, which was established by Ian Murdock in August 1993. Debian is one of the oldest operating systems based on the Linux kerne ...
package in Debian-based operating systems.
To make a HarmonyOS app, a software development tool such as
DevEco Studio is required to code and pack HarmonyOS Ability Package (HAP) and associated files into an app package.
The HAP files may consist of resources, third-party
libraries
A library is a collection of Book, books, and possibly other Document, materials and Media (communication), media, that is accessible for use by its members and members of allied institutions. Libraries provide physical (hard copies) or electron ...
and
configuration files
A configuration file, a.k.a. config file, is a file that stores data used to configure a software system such as an application, a server or an operating system.
Some applications provide a tool to create, modify, and verify the syntax of the ...
. They are classified into two types of modules, i.e., entry and feature. The entry type of the HAP files is the main module and must be included into an app package, while the feature type of the HAP files is additional modules for implementing the features of the apps.
Moreover, an App file that contains different builds and specifications optimized for the various devices may contain more than one HAP file of the entry type.
Historically, the development of the HAP format has gone through two phases. The first stage, after decompression, there was a non-executable
APK as the program entrance to connect with AOSP file libraries of binaries to interact with AOSP base of HarmonyOS 2.0 API 6, which is caused by the imperfect ecology of the early development of the new app file format during dual framework of OpenHarmony L3-L5 that consists of
EMUI
EMUI (formerly known as Emotion UI) is an interface based on Android (operating system) developed by Chinese technology company Huawei, used on the company's smartphones primarily globally.
Instead of Google Mobile Services, EMUI devices have ...
Android base convergence. During early app development, third party developers facilitated development for mixed packaging of APK and HAP. Since introduction of HAR libraries on HarmonyOS 3.1 API 9 with
ArkUI
HarmonyOS (HMOS) ( zh, s=鸿蒙, p=Hóngméng, tr=Vast Mist) is a distributed operating system developed by Huawei for smartphones, tablets, smart TVs, smart watches, personal computers and other smart devices. It has a microkernel design wi ...
declarative programming framework and
ArkTS
ArkTS (short for Ark TypeScript) is a high-level general-purpose, multi-paradigm, compiled, declarative, static type programming language developed by Huawei which is an extension superset of open-source TypeScript (TS), in turn a super ...
evolved from eTS on 3.0, as primary programming language replacing
Java
Java is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea (a part of Pacific Ocean) to the north. With a population of 156.9 million people (including Madura) in mid 2024, proje ...
binaries in the second stage of HAP, APKs was eliminated after decompression, and HAP cannot be converted into APKs by simple unpacking and packaging, therefore HAP file format is not a casing of the APK.
Prior to packing into an App Pack, HAP files are allowed to run directly on a real device or an emulator for developers to
debug
In engineering, debugging is the process of finding the root cause, workarounds, and possible fixes for bugs.
For software, debugging tactics can involve interactive debugging, control flow analysis, log file analysis, monitoring at the ap ...
and verify the apps during the development phase.
After development, the apps containing signature information can be distributed to different devices with AppGallery Connect, a tool kit of services for creation, development, distribution and maintenance of an app.
Shared packages

For sharing code and resources in an App Pack, the operating system offers two kinds of shared packages: Harmony Archive (HAR), which is a static shared package, and Harmony Shared Package (HSP), which is a dynamic shared package.
Both HAR and HSP enable sharing of code, C++ libraries, resources, and configuration files. In HAR, the code and resources are compiled together with invoking modules, possibly resulting in multiple copies of the same code and resources. In contrast, HSP allows independent compilation, leading to only one copy of code and resources in the build product.
When multiple HAPs reference the same HAR, the HSP can be used instead to share some state variables and reduce the size of an App Pack. However, the HSP has some restrictions; for example, it does not support the declaration of abilities in its configuration file and its invoking modules must be in the same stage model as with the HSP.
On
OpenHarmony
OpenHarmony (OHOS, OH) is a family of open-source distributed operating systems based on HarmonyOS derived from LiteOS, donated the L0-L2 branch source code by Huawei to the OpenAtom Foundation. Similar to HarmonyOS, the open-source distrib ...
4.1 API 11 improvements with System-level HSP that supports OTA upgrades within the App Package Management system. Also, the API 11 upgrade under Public Basic Class Library supports the creation of Workers within HSP and HAR that is something a user give a task and continue in the process, while the worker, or multiple workers also known as
Thread pool
In computer programming, a thread pool is a software design pattern for achieving concurrency of execution in a computer program. Often also called a replicated workers or worker-crew model, a thread pool maintains multiple threads waiting for ...
s, process the task on a different thread. A call back method is initiated when a special method provided on the initial call gets called.
App file structure
The structure of the App file after built and packaged in a stage model usually contains the following files and folders.
*
entry.hap
and
feature.hap
: the basic modules of both entry and feature types for installing an app, containing the following folders and files.
**
ets
: a folder storing bytecode files generated after the code build.
**
libs
: a folder storing the dependency files of the main module.
**
resources
: a folder containing resource files such as graphics, multimedia, character strings, and layouts.
**
resources.index
: a file providing a resource index table generated when an app is built.
**
app.json5
and
module.json5
:
JSON
JSON (JavaScript Object Notation, pronounced or ) is an open standard file format and electronic data interchange, data interchange format that uses Human-readable medium and data, human-readable text to store and transmit data objects consi ...
files with configuration information for build tools, operating system and application markets.
*
pack.info
: a file describing the attributes of the App Pack.
See also
*
apk (file format)
*
.ipa
*
.exe
References
{{Archive formats
Mobile operating systems
Archive formats