Structure of the app Tag
The app tag contains application-wide configuration. The following table describes its internal structure.
Table 1 Internal structure of the app tag
| Name | Description | Data Type | Initial Value Allowed |
|---|---|---|---|
| bundleName | Bundle name, which uniquely identifies an application. The bundle name must start with a letter and can contain only letters, digits, underscores (_), and periods (.). The bundle name is represented as a reverse domain name of 7 to 128 bytes, for example, "com.example.myapplication". It is recommended that the first level be the domain suffix "com" and the second level be the vendor/individual name. More levels are also accepted. |
String | No |
| vendor | Vendor of the application. The value is a string with a maximum of 255 bytes. | String | Yes (initial value: left empty) |
| version | Version of the application. | Object | No |
| apiVersion | Operating system and API version on which the application depends. | Object | Yes (initial value: left empty) |
| smartWindowSize | Screen size used when the application runs in the Emulator. | String | Yes (initial value: left empty) |
| smartWindowDeviceType | Types of the emulated devices on which the application can run. | String array | Yes (initial value: left empty) |
| asanEnabled | Whether to enable AddressSanitizer (ASan) to detect memory corruption issues such as buffer overflows. - true: ASan is enabled. - false: ASan is disabled. |
Boolean | Yes (initial value: false) |
Internal Structure of the version Attribute
Table 2 Internal structure of the version attribute
| Name | Description | Data Type | Initial Value Allowed |
|---|---|---|---|
| name | Application version number displayed to users. The value can be customized and cannot exceed 127 bytes. The configuration rules are as follows: For API version 5 and earlier versions, use the three-part format A.B.C (compatible with a two-part format A.B), where A, B, and C are integers ranging from 0 to 999. A indicates the major version number. B indicates the minor version number. C indicates the patch version number. For API version 6 and later versions, the four-part format A.B.C.D is recommended, where A, B, and C are integers ranging from 0 to 99, and D is an integer ranging from 0 to 999. A indicates the major version number. B indicates the minor version number. C indicates the feature version number. D indicates the patch version number. |
String | No |
| code | Application version number used only for application management by the operating system. It is not visible to end users. The configuration rules are as follows: API version 5 and earlier versions: The value is a non-negative integer within 32 binary digits, which is converted from the value of version.name. The conversion rule is as follows: Value of code = A × 1,000,000 + B × 1,000 + C. For example, if the value of version.name is 2.2.1, the value of code is 2002001. API version 6 and later versions: The value of code is not associated with the value of version.name and can be customized. The value is a non-negative integer less than 2 to the power of 31. Note that the value must be updated each time the application version is updated, and the value for a later version must be greater than that for an earlier version. |
Number | No |
| minCompatibleVersionCode | Earliest version compatible with the application. It is used in the cross-device scenario to check whether the application is compatible with a specific version on other devices. The value rules are the same as those of version.code. | Number | No (initial value: value of code) |
Internal Structure of the apiVersion Attribute
Table 3 Internal structure of the apiVersion attribute
| Name | Description | Data Type | Initial Value Allowed |
|---|---|---|---|
| compatible | Minimum API version required for running the application. The value ranges from 0 to 2147483647. | Number | Yes (initial value: configured in build.profile and filled in config.json by DevEco Studio during packaging) |
| target | Target API version required for running the application. The value ranges from 0 to 2147483647. | Number | Yes (initial value: configured in build.profile and filled in config.json by DevEco Studio during packaging) |
| releaseType | SDK status when the application is running. canaryN: Early preview version for specific developers. No quality guarantee or API stability guarantee is provided. N represents an integer greater than 0 and is used to distinguish different versions. betaN: Publicly released Beta version. Early Beta versions do not guarantee API stability. After several releases, a Beta version may be declared as an API stability milestone for developers through the Release Notes. APIs are frozen in subsequent versions. N represents an integer greater than 0 and is used to distinguish different versions. release: official release open to all developers. This release promises that all APIs are stable. When a version is in this state, the stage field is not displayed in the version number. |
String | Yes (initial value: configured in build.profile and filled in config.json by DevEco Studio during packaging) |
Example of the app tag:
"app": {
"bundleName": "com.example.myapplication",
"vendor": "example",
"version": {
"code": 8,
"name": "8.0.1"
},
"apiVersion": {
"compatible": 8,
"target": 9,
"releaseType": "Beta1"
}
}