App (file Format)
   HOME

TheInfoList



OR:

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) () is a distributed operating system developed by Huawei to collaborate and interconnect with multiple smart devices on the Internet of Things (IoT) ecosystem. In its current multi-kernel design, the operating system selects ...
operating system. It functions as a
native Native may refer to: People * Jus soli, citizenship by right of birth * Indigenous peoples, peoples with a set of specific rights based on their historical ties to a particular territory ** Native Americans (disambiguation) In arts and entert ...
HarmonyOS app for distribution and installation through
Huawei AppGallery Huawei AppGallery (abbreviated AppGallery onscreen) is a package manager and application distribution platform, or marketplace 'app store', developed by Huawei Technologies Co., Ltd. for the Google-developed open-source Android operating syst ...
, or for distribution through Huawei Ability Gallery in respect of installation-free apps. The App file is also used by a number of other
open source Open source is source code that is made freely available for possible modification and redistribution. Products include permission to use the source code, design documents, or content of the product. The open-source model is a decentralized sof ...
HarmonyOS-based operating systems such as
OpenHarmony OpenAtom OpenHarmony, or abbreviated as OpenHarmony (OHOS), is an open-source version of HarmonyOS donated by Huawei to the OpenAtom Foundation. Similar to HarmonyOS, the open-source operating system is designed with a layered architecture, whic ...
and Oniro OS-based operating systems for distribution and installation of applications,
video games Video games, also known as computer games, are electronic games that involves interaction with a user interface or input device such as a joystick, game controller, controller, computer keyboard, keyboard, or motion sensing device to gener ...
and
middleware Middleware is a type of computer software that provides services to software applications beyond those available from the operating system. It can be described as "software glue". Middleware makes it easier for software developers to implement co ...
. Including non OpenHarmony-based operating systems, such as GNU
Linux Linux ( or ) is a family of open-source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically packaged as a Linux distribution, which ...
-based
Unity Operating System Unity Operating System (also known as Unified Operating System or UOS, ) is a Chinese Linux distribution developed by UnionTech () based on Deepin, which is based on Debian. It is used in China as part of a government initiative beginning in 201 ...
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 Android may refer to: Science and technology * Android (robot), a humanoid robot or synthetic organism designed to imitate a human * Android (operating system), Google's mobile operating system ** Bugdroid, a Google mascot sometimes referred to ...
operating system,
appx Universal Windows Platform (UWP) apps (formerly Windows Store apps and Metro-style apps) are applications that can be used across all compatible Microsoft Windows devices, including personal computers (PCs), tablets, smartphones, Xbox One, Mic ...
in
Microsoft Windows Windows is a group of several proprietary graphical operating system families developed and marketed by Microsoft. Each family caters to a certain sector of the computing industry. For example, Windows NT for consumers, Windows Server for serv ...
, or a
Debian Debian (), also known as Debian GNU/Linux, is a Linux distribution composed of free and open-source software, developed by the community-supported Debian Project, which was established by Ian Murdock on August 16, 1993. The first version of D ...
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 and
configuration files In computing, configuration files (commonly known simply as config files) are files used to configure the parameters and initial settings for some computer programs. They are used for user applications, server processes and operating system set ...
. 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. 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 computer programming and software development, debugging is the process of finding and resolving '' bugs'' (defects or problems that prevent correct operation) within computer programs, software, or systems. Debugging tactics can involve int ...
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.


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 ; also ) is an open standard file format and data interchange format that uses human-readable text to store and transmit data objects consisting of attribute–value pairs and arrays (or other ser ...
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 An .ipa file is an iOS and iPadOS application archive file which stores an iOS/iPadOS app. Each .ipa file includes a binary and can only be installed on an iOS, iPadOS, or ARM-based macOS device. Files with the .ipa extension can be uncompressed ...


References

{{Archive formats Mobile operating systems Archive formats