1e41f4b71Sopenharmony_ci# Packing Tool 2e41f4b71Sopenharmony_ci 3e41f4b71Sopenharmony_ciThe packing tool packs compiled files for installation and release. You can use DevEco Studio or the JAR package of the packaging tool to pack files. The JAR package is usually stored in the **toolchains** directory of the SDK. 4e41f4b71Sopenharmony_ci 5e41f4b71Sopenharmony_ciThe packing tool supports the generation of HAP (module package of the ability type), HSP (dynamically shared package), APP (application program package), HQF (quick fix module package), and APPQF (quick fix package) files. 6e41f4b71Sopenharmony_ci 7e41f4b71Sopenharmony_ci 8e41f4b71Sopenharmony_ci## Constraints 9e41f4b71Sopenharmony_ci 10e41f4b71Sopenharmony_ciThe packing tool must run in Java8 or later. 11e41f4b71Sopenharmony_ci 12e41f4b71Sopenharmony_ci 13e41f4b71Sopenharmony_ci## HAP Packing Command 14e41f4b71Sopenharmony_ci 15e41f4b71Sopenharmony_ciYou can use the JAR package of the packing tool to generate an HAP file for a module by passing in packing options and file paths. 16e41f4b71Sopenharmony_ci 17e41f4b71Sopenharmony_ci- Packing command example in the stage model: 18e41f4b71Sopenharmony_ci 19e41f4b71Sopenharmony_ci 20e41f4b71Sopenharmony_ci ``` 21e41f4b71Sopenharmony_ci java -jar app_packing_tool.jar --mode hap --json-path <path> [--resources-path <path>] [--ets-path <path>] [--index-path <path>] [--pack-info-path <path>] [--lib-path <path>] --out-path <path> [--force true] [--compress-level 5] [--pkg-context-path <path>] [--hnp-path <path>] 22e41f4b71Sopenharmony_ci ``` 23e41f4b71Sopenharmony_ci 24e41f4b71Sopenharmony_ci- Packing command example in the FA model: 25e41f4b71Sopenharmony_ci 26e41f4b71Sopenharmony_ci 27e41f4b71Sopenharmony_ci ``` 28e41f4b71Sopenharmony_ci java -jar app_packing_tool.jar --mode hap --json-path <path> [--maple-so-path <path>] [--profile-path <path>] [--maple-so-dir <path>] [--dex-path <path>] [--lib-path <path>] [--resources-path <path>] [--index-path <path>] --out-path <path> [--force true] [--compress-level 5] 29e41f4b71Sopenharmony_ci ``` 30e41f4b71Sopenharmony_ci 31e41f4b71Sopenharmony_ci**Table 1** Parameters of the HAP packing command 32e41f4b71Sopenharmony_ci 33e41f4b71Sopenharmony_ci| Name | Mandatory| Option | Description | Remarks | 34e41f4b71Sopenharmony_ci| ---------------- | ---------- | ------------- | ------------------------------------------------------------ | --------------- | 35e41f4b71Sopenharmony_ci| --mode | Yes | hap | Packing mode. | NA | 36e41f4b71Sopenharmony_ci| --json-path | Yes | NA | Path of the JSON file. The file name must be **config.json** in the FA model and **module.json** in the stage model.| NA | 37e41f4b71Sopenharmony_ci| --profile-path | No | NA | Path of the **CAPABILITY.profile** file. | NA | 38e41f4b71Sopenharmony_ci| --maple-so-path | No | NA | Path of the Maple SO file. The file name extension must be .so. If there are multiple SO files, separate them with commas (,).| NA | 39e41f4b71Sopenharmony_ci| --maple-so-dir | No | NA | Path of the maple SO directory (folder). | NA | 40e41f4b71Sopenharmony_ci| --dex-path | No | NA | Path of the DEX file. The file name extension must be .dex. If there are multiple DEX files, separate them with commas (,).<br>The value can also be the directory (folder) where the DEX file is stored.| NA | 41e41f4b71Sopenharmony_ci| --lib-path | No | NA | Path of the library file. | NA | 42e41f4b71Sopenharmony_ci| --resources-path | No | NA | Path of the resources file. | NA | 43e41f4b71Sopenharmony_ci| --index-path | No | NA | Path of the INDEX file. The file name must be **resources.index**. | NA | 44e41f4b71Sopenharmony_ci| --pack-info-path | No | NA | Path of the **pack.info** file. The file name must be **pack.info**. | NA | 45e41f4b71Sopenharmony_ci| --rpcid-path | No | NA | Path of the **rpcid.sc** file. The file name must be **rpcid.sc**. | NA | 46e41f4b71Sopenharmony_ci| --js-path | No | NA | Path of the JS file. | This parameter is valid only in the stage model.| 47e41f4b71Sopenharmony_ci| --ets-path | No | NA | Path of the ETS file. | This parameter is valid only in the stage model.| 48e41f4b71Sopenharmony_ci| --out-path | Yes | NA | Path of the target file. The file name extension must be .hap. | NA | 49e41f4b71Sopenharmony_ci| --force | No | true or false| The default value is **false**. If the value is **true**, an existing target file will be forcibly deleted during packing. | NA | 50e41f4b71Sopenharmony_ci| --an-path | No | NA | Path of the AN file. | This parameter is valid only in the stage model.| 51e41f4b71Sopenharmony_ci| --ap-path | No | NA | Path of the AP file. | This parameter is valid only in the stage model.| 52e41f4b71Sopenharmony_ci| --dir-list | No | NA | List of directories (folders) to be packed into the HAP file. | NA | 53e41f4b71Sopenharmony_ci| --compress-level | No | number | Compression level, ranging from 1 to 9. The default value is **1**. This parameter is valid only when **compressNativeLibs** is set to **true**. A larger value indicates a higher compression rate and a slower compression speed.| NA | 54e41f4b71Sopenharmony_ci| --pkg-context-path | No | NA | Path of the **pkgContextInfo.json** file, which contains the context information.| This parameter is valid only in the stage model. | 55e41f4b71Sopenharmony_ci| --hnp-path | No| NA | Path of the native software package to be packed into the HAP file.| NA | 56e41f4b71Sopenharmony_ci 57e41f4b71Sopenharmony_ci## HSP Packing Command 58e41f4b71Sopenharmony_ci 59e41f4b71Sopenharmony_ciHSP files enable file sharing among multiple HAPs. You can use the JAR package of the packing tool to generate an HSP file for an application by passing in packing options and file paths. 60e41f4b71Sopenharmony_ci 61e41f4b71Sopenharmony_ciPacking command example: 62e41f4b71Sopenharmony_ci``` 63e41f4b71Sopenharmony_cijava -jar app_packing_tool.jar --mode hsp --json-path <path> [--resources-path <path>] [--ets-path <path>] [--index-path <path>] [--pack-info-path <path>] [--lib-path <path>] --out-path <path> [--force true] [--compress-level 5] [--pkg-context-path <path>] 64e41f4b71Sopenharmony_ci``` 65e41f4b71Sopenharmony_ci 66e41f4b71Sopenharmony_ci**Table 2** Parameters of the HSP packing command 67e41f4b71Sopenharmony_ci 68e41f4b71Sopenharmony_ci| Name | Mandatory| Option | Description | 69e41f4b71Sopenharmony_ci| ---------------- | ---------- | ------------- | ------------------------------------------------------------ | 70e41f4b71Sopenharmony_ci| --mode | Yes | hsp | Packing mode. | 71e41f4b71Sopenharmony_ci| --json-path | Yes | NA | Path of the JSON file. The file name must be **module.json**. | 72e41f4b71Sopenharmony_ci| --profile-path | No | NA | Path of the **CAPABILITY.profile** file. | 73e41f4b71Sopenharmony_ci| --dex-path | No | NA | Path of the DEX file. The file name extension must be .dex. If there are multiple DEX files, separate them with commas (,).<br>The value can also be the directory (folder) where the DEX file is stored.| 74e41f4b71Sopenharmony_ci| --lib-path | No | NA | Path of the library file. | 75e41f4b71Sopenharmony_ci| --resources-path | No | NA | Path of the resources file. | 76e41f4b71Sopenharmony_ci| --index-path | No | NA | Path of the INDEX file. The file name must be **resources.index**. | 77e41f4b71Sopenharmony_ci| --pack-info-path | No | NA | Path of the **pack.info** file. The file name must be **pack.info**. | 78e41f4b71Sopenharmony_ci| --js-path | No | NA | Path of the JS file. | 79e41f4b71Sopenharmony_ci| --ets-path | No | NA | Path of the ETS file. | 80e41f4b71Sopenharmony_ci| --out-path | Yes | NA | Path of the target file. The file name extension must be .hsp. | 81e41f4b71Sopenharmony_ci| --force | No | true or false| The default value is **false**. If the value is **true**, an existing target file will be forcibly deleted during packing. | 82e41f4b71Sopenharmony_ci| --compress-level | No | number | Compression level, ranging from 1 to 9. The default value is **1**. This parameter is valid only when **compressNativeLibs** is set to **true**. A larger value indicates a higher compression rate and a slower compression speed.| 83e41f4b71Sopenharmony_ci| --pkg-context-path | No | NA | Path of the **pkgContextInfo.json** file, which contains the context information.| 84e41f4b71Sopenharmony_ci 85e41f4b71Sopenharmony_ci## APP Packing Command 86e41f4b71Sopenharmony_ci 87e41f4b71Sopenharmony_ciYou can use the JAR package of the packing tool to generate an APP file for an application by passing in packing options and file paths. The APP file is used to release the application to the application market. 88e41f4b71Sopenharmony_ci 89e41f4b71Sopenharmony_ci**HAP validity check**: When packing the HAP files in a project to generate an APP file, ensure that the values of **bundleName**, **versionCode**, **minCompatibleVersionCode**, **debug**, **minAPIVersion**, and **targetAPIVersion** configured in each JSON file of the HAP are the same, and the value of **moduleName** is unique in all the JSON files. For the FA model, you must also ensure that the value of **package** is unique in all the JSON files. The HAP modules must have the same **apiReleaseType**. The **apiReleaseType** of HSP modules is not checked. 90e41f4b71Sopenharmony_ci 91e41f4b71Sopenharmony_ci**Compression rules**: When packaging the APP files, the HAP and HSP files in release mode are compressed, but the HAP and HSP files in debug mode are not compressed. 92e41f4b71Sopenharmony_ci 93e41f4b71Sopenharmony_ci>**NOTE** 94e41f4b71Sopenharmony_ci> 95e41f4b71Sopenharmony_ci>Since API version 12, **versionName** is not verified during application packing. 96e41f4b71Sopenharmony_ci 97e41f4b71Sopenharmony_ciPacking command example: 98e41f4b71Sopenharmony_ci 99e41f4b71Sopenharmony_ci``` 100e41f4b71Sopenharmony_cijava -jar app_packing_tool.jar --mode app [--hap-path <path>] [--hsp-path <path>] --out-path <path> [--signature-path <path>] [--certificate-path <path>] --pack-info-path <path> [--force true] 101e41f4b71Sopenharmony_ci``` 102e41f4b71Sopenharmony_ci 103e41f4b71Sopenharmony_ci**Table 3** Parameters of the APP packing command 104e41f4b71Sopenharmony_ci 105e41f4b71Sopenharmony_ci| Name | Mandatory| Option | Description | 106e41f4b71Sopenharmony_ci|--------------------|-------|-------------|--------------------------------------------------------------| 107e41f4b71Sopenharmony_ci| --mode | Yes | app | Packing mode. Each HAP file to pack into the APP file must pass the validity check. | 108e41f4b71Sopenharmony_ci| --hap-path | No | NA | Path of the HAP file. The file name extension must be .hap. If there are multiple HAP files, separate them with commas (,).<br>The value can also be the directory (folder) where the HAP file is stored.| 109e41f4b71Sopenharmony_ci| --hsp-path | No | NA | Path of the HSP file. The file name extension must be .hsp. If there are multiple HSP files, separate them with commas (,).<br>The value can also be the directory (folder) where the HSP file is stored.| 110e41f4b71Sopenharmony_ci| --pack-info-path | Yes | NA | Path of the **pack.info** file. The file name must be **pack.info**. | 111e41f4b71Sopenharmony_ci| --out-path | Yes | NA | Path of the target file. The file name extension must be .app. | 112e41f4b71Sopenharmony_ci| --signature-path | No | NA | Path of the signature file. | 113e41f4b71Sopenharmony_ci| --certificate-path | No | NA | Path of the certificate file. | 114e41f4b71Sopenharmony_ci| --pack-res-path | No | NA | Path of the **pack.res** file. | 115e41f4b71Sopenharmony_ci| --force | No | true or false| The default value is **false**. If the value is **true**, an existing target file will be forcibly deleted during packing. | 116e41f4b71Sopenharmony_ci 117e41f4b71Sopenharmony_ci 118e41f4b71Sopenharmony_ci 119e41f4b71Sopenharmony_ci## Multi-project Packing Command 120e41f4b71Sopenharmony_ci 121e41f4b71Sopenharmony_ciIf multiple teams develop the same application but it is inconvenient to share code, you can use multi-project packing, which packs the packed HAP, HSP, and APP files into a final APP file and releases it to the application market. 122e41f4b71Sopenharmony_ci 123e41f4b71Sopenharmony_ci**HAP validity check**: Ensure that the values of **bundleName**, **versionCode**, **minCompatibleVersionCode**, **debug**, **minAPIVersion**, **targetAPIVersion**, **compileSdkVersion**, and **compileSdkType** configured in each JSON file of the HAP are the same, the value of **moduleName** is unique in all the JSON files, and the value of **entry** is unique for the same device. For the FA model, you must also ensure that the value of **package** is unique in all the JSON files. The HAP modules must have the same **apiReleaseType**. The **apiReleaseType** of HSP modules is not checked. 124e41f4b71Sopenharmony_ci 125e41f4b71Sopenharmony_ci>**NOTE** 126e41f4b71Sopenharmony_ci> 127e41f4b71Sopenharmony_ci>Since API version 12, **versionName** is not verified during multi-project packing. 128e41f4b71Sopenharmony_ci 129e41f4b71Sopenharmony_ciPacking command example: 130e41f4b71Sopenharmony_ci 131e41f4b71Sopenharmony_ci``` 132e41f4b71Sopenharmony_cijava -jar app_packing_tool.jar --mode multiApp [--hap-list <path>] [--hsp-list <path>] [--app-list <path>] --out-path <option> [--force true] 133e41f4b71Sopenharmony_ci``` 134e41f4b71Sopenharmony_ci 135e41f4b71Sopenharmony_ci**Table 4** Parameters of the multi-project packing command 136e41f4b71Sopenharmony_ci 137e41f4b71Sopenharmony_ci| Name | Mandatory| Option | Description | 138e41f4b71Sopenharmony_ci|------------|-------|-----------|-----------------------------------------------------------------------------------------------------| 139e41f4b71Sopenharmony_ci| --mode | Yes | multiApp | Packing mode. Each HAP file to pack into the APP file must pass the validity check. | 140e41f4b71Sopenharmony_ci| --hap-list | No | Path of the HAP files | Path of the HAP files. The file name extension must be .hap. If there are multiple HAP files, separate them with commas (,).<br>The value can also be the directory (folder) where the HAP files are stored. | 141e41f4b71Sopenharmony_ci| --hsp-list | No | Path of the HSP files | Path of the HSP files. The file name extension must be .hsp. If there are multiple HSP files, separate them with commas (,).<br>The value can also be the directory (folder) where the HSP files are stored. | 142e41f4b71Sopenharmony_ci| --app-list | No | Path of the APP files | Path of the APP files. The file name extension must be .app. If there are multiple APP files, separate them with commas (,).<br>The value can also be the directory (folder) where the APP files are stored.<br>You must specify **--hap-list**, **--hsp-list**, or **--app-list**, or any of their combinations.| 143e41f4b71Sopenharmony_ci| --out-path | Yes | NA | Path of the target file. The file name extension must be .hqf.| 144e41f4b71Sopenharmony_ci| --force | No | true or false| The default value is **false**. If the value is **true**, an existing target file will be forcibly deleted during packing. | 145e41f4b71Sopenharmony_ci 146e41f4b71Sopenharmony_ci 147e41f4b71Sopenharmony_ci 148e41f4b71Sopenharmony_ci## HQF Packing Command 149e41f4b71Sopenharmony_ci 150e41f4b71Sopenharmony_ciIf you find detects in the application and want to rectify the defects quickly, you can use HQF files. You can use the JAR package of the packing tool to generate an HQF file for an application by passing in packing options and file paths. 151e41f4b71Sopenharmony_ci 152e41f4b71Sopenharmony_ciPacking command example: 153e41f4b71Sopenharmony_ci 154e41f4b71Sopenharmony_ci``` 155e41f4b71Sopenharmony_cijava -jar app_packing_tool.jar --mode hqf --json-path <path> [--lib-path <path>] [--ets-path <path>] [--resources-path <path>] --out-path <path> [--force true] 156e41f4b71Sopenharmony_ci``` 157e41f4b71Sopenharmony_ci 158e41f4b71Sopenharmony_ci**Table 5** Parameters of the HQF packing command 159e41f4b71Sopenharmony_ci 160e41f4b71Sopenharmony_ci| Name | Mandatory| Option | Description | 161e41f4b71Sopenharmony_ci|-------------|-------|-------------|------------------------------------| 162e41f4b71Sopenharmony_ci| --mode | Yes | hqf | Packing mode. | 163e41f4b71Sopenharmony_ci| --json-path | Yes | NA | Path of the JSON file. The file name must be **patch.json**. | 164e41f4b71Sopenharmony_ci| --lib-path | No | NA | Path of the library file. | 165e41f4b71Sopenharmony_ci| --ets-path | No | NA | Path of the ETS file. | 166e41f4b71Sopenharmony_ci| --resources-path | No | NA | Path of the resources file. | 167e41f4b71Sopenharmony_ci| --out-path | Yes | NA | Path of the target file. The file name extension must be .hqf. | 168e41f4b71Sopenharmony_ci| --force | No | true or false| The default value is **false**. If the value is **true**, an existing target file will be forcibly deleted during packing.| 169e41f4b71Sopenharmony_ci 170e41f4b71Sopenharmony_ci## APPQF Packing Command 171e41f4b71Sopenharmony_ci 172e41f4b71Sopenharmony_ciAn APPQF file consists of one or more HQF files. These HQF files are split from an APPQF file in the application market and then distributed to specific devices. You can use the JAR package of the packing tool to generate an APPQF file for an application by passing in packing options and file paths. 173e41f4b71Sopenharmony_ci 174e41f4b71Sopenharmony_ciPacking command example: 175e41f4b71Sopenharmony_ci 176e41f4b71Sopenharmony_ci``` 177e41f4b71Sopenharmony_cijava -jar app_packing_tool.jar --mode appqf --hqf-list <path> --out-path <path> [--force true] 178e41f4b71Sopenharmony_ci``` 179e41f4b71Sopenharmony_ci 180e41f4b71Sopenharmony_ci**Table 6** Parameters of the APPQF packing command 181e41f4b71Sopenharmony_ci 182e41f4b71Sopenharmony_ci| Name | Mandatory| Option | Description | 183e41f4b71Sopenharmony_ci|------------|-------|-------------|------------------------------------| 184e41f4b71Sopenharmony_ci| --mode | Yes | appqf | Packing mode. | 185e41f4b71Sopenharmony_ci| --hqf-list | Yes | NA | Path of the HQF file. If there are multiple HQF files, separate them with commas (,). | 186e41f4b71Sopenharmony_ci| --out-path | Yes | NA | Path of the target file. The file name extension must be .appqf. | 187e41f4b71Sopenharmony_ci| --force | No | true or false| The default value is **false**. If the value is **true**, an existing target file will be forcibly deleted during packing.| 188e41f4b71Sopenharmony_ci 189e41f4b71Sopenharmony_ci## versionNormalize Command 190e41f4b71Sopenharmony_ci 191e41f4b71Sopenharmony_ciFor the same APP, the values of **versionName** and **versionCode** of all the HAP and HSP files must be the same. When only one HAP or HSP needs to be updated, you can run the **versionNormalize** command to unify the versions of these HAP or HSP files. This command changes the version numbers and names of the HAP and HSP files passed in, and generates in the specified directory new HAP and HSP files with the same names and a **version_record.json** file to record their original version numbers and names. 192e41f4b71Sopenharmony_ci 193e41f4b71Sopenharmony_ciPacking command example: 194e41f4b71Sopenharmony_ci``` 195e41f4b71Sopenharmony_cijava -jar path\app_packing_tool.jar --mode versionNormalize --input-list 1.hap,2.hsp --version-code 1000001 --version-name 1.0.1 --out-path path\out\ 196e41f4b71Sopenharmony_ci``` 197e41f4b71Sopenharmony_ci 198e41f4b71Sopenharmony_ci**Table 7** Parameters of the versionNormalize command 199e41f4b71Sopenharmony_ci 200e41f4b71Sopenharmony_ci| Name | Mandatory| Option | Description | 201e41f4b71Sopenharmony_ci|----------------|-------|------------------|-------------------------------------------------------------------| 202e41f4b71Sopenharmony_ci| --mode | Yes | versionNormalize | Command type. | 203e41f4b71Sopenharmony_ci| --input-list | Yes | Path of the HAP or HSP files | Path of the HAP or HSP files. The file name extension must be .hap or .hsp. If there are multiple HAP or HSP files, separate them with commas (,).<br>The value can also be the directory (folder) where the HAP and HSP files are stored. If this is the case, all HAP and HSP files in the directory (folder) are read.| 204e41f4b71Sopenharmony_ci| --version-code | Yes | Internal version number | New internal version number of the HAP and HSP files. The value must be an integer and cannot be earlier than the version numbers of all the HAP and HSP files passed in. | 205e41f4b71Sopenharmony_ci| --version-name | Yes | Version name | New version name of the HAP and HSP files. | 206e41f4b71Sopenharmony_ci| --out-path | Yes | NA | Target file path, which must be a directory (folder). | 207e41f4b71Sopenharmony_ci 208e41f4b71Sopenharmony_ci## packageNormalize Command 209e41f4b71Sopenharmony_ci 210e41f4b71Sopenharmony_ciThe **packageNormalize** command is used to change the passed-in HSP bundle name and version number and generate an HSP with the same name in the specified directory. 211e41f4b71Sopenharmony_ci 212e41f4b71Sopenharmony_ciPacking command example: 213e41f4b71Sopenharmony_ci``` 214e41f4b71Sopenharmony_cijava -jar path\app_packing_tool.jar --mode packageNormalize --hsp-list path\1.hsp,path\2.hsp --bundle-name com.example.myapplication --version-code 1000001 --out-path path\out\ 215e41f4b71Sopenharmony_ci``` 216e41f4b71Sopenharmony_ci 217e41f4b71Sopenharmony_ci**Table 8** Parameters of the packageNormalize command 218e41f4b71Sopenharmony_ci 219e41f4b71Sopenharmony_ci| Name | Mandatory| Option | Description | 220e41f4b71Sopenharmony_ci|----------------|-------|---------------|-----------------------------------------------------| 221e41f4b71Sopenharmony_ci| --mode | Yes | packageNormalize | Command type. | 222e41f4b71Sopenharmony_ci| --hsp-list | Yes | Path of the HSP files | Path of the HSP file. The file name extension must be .hsp. If there are multiple HSP files, separate them with commas (,). The value can also be the directory (folder) where the HSP files are stored.| 223e41f4b71Sopenharmony_ci| --bundle-name | Yes | Bundle name | New bundle name, to which the passed-in bundle name will be changed. | 224e41f4b71Sopenharmony_ci| --version-code | Yes | Internal version number | New version number, to which the passed-in version number will be changed. The value must be an integer greater than 0. | 225e41f4b71Sopenharmony_ci| --out-path | Yes | NA | Target file path, which must be a directory (folder). | 226e41f4b71Sopenharmony_ci 227e41f4b71Sopenharmony_ci## RES Packing Command 228e41f4b71Sopenharmony_ci 229e41f4b71Sopenharmony_ciUsed to generate an HAP file for the **pack.res** file. 230e41f4b71Sopenharmony_ci 231e41f4b71Sopenharmony_ciPacking command example: 232e41f4b71Sopenharmony_ci 233e41f4b71Sopenharmony_ci``` 234e41f4b71Sopenharmony_cijava -jar app_packing_tool.jar --mode res --entrycard-path <path> --pack-info-path <path> --out-path <path> [--force true] 235e41f4b71Sopenharmony_ci``` 236e41f4b71Sopenharmony_ci 237e41f4b71Sopenharmony_ci**Table 9** Parameters of the RES packing command 238e41f4b71Sopenharmony_ci 239e41f4b71Sopenharmony_ci| Name | Mandatory| Option | Description | 240e41f4b71Sopenharmony_ci|------------------|-------|---------------|------------------------------------| 241e41f4b71Sopenharmony_ci| --mode | Yes | res | Command type. | 242e41f4b71Sopenharmony_ci| --entrycard-path | Yes | NA | Path of the **pack.res** file. | 243e41f4b71Sopenharmony_ci| --pack-info-path | Yes | NA | Path of the **pack.info** file. | 244e41f4b71Sopenharmony_ci| --out-path | Yes | NA | Path of the target file. The file name extension must be .res. | 245e41f4b71Sopenharmony_ci| --force | No | true or false | The default value is **false**. If the value is **true**, an existing target file will be forcibly deleted during packing.| 246e41f4b71Sopenharmony_ci 247e41f4b71Sopenharmony_ci## FastApp Packing Commands 248e41f4b71Sopenharmony_ci 249e41f4b71Sopenharmony_ciYou can use the JAR package of the packing tool to generate an APP file for a fast application by passing in packing options and path of the HAP or HSP files. The APP file is used to release the application to the application market. 250e41f4b71Sopenharmony_ci 251e41f4b71Sopenharmony_ci**HAP validity check**: When packing the HAP files in a project to generate an APP file, ensure that the values of **bundleName**, **versionCode**, **minCompatibleVersionCode**, **debug**, **minAPIVersion**, and **targetAPIVersion** configured in each JSON file of the HAP are the same, and the value of **moduleName** is unique in all the JSON files. The HAP modules must have the same **apiReleaseType**. The **apiReleaseType** of HSP modules is not checked. 252e41f4b71Sopenharmony_ci 253e41f4b71Sopenharmony_ci**Compression rules**: When packaging the APP files, the HAP and HSP files in release mode are compressed, but the HAP and HSP files in debug mode are not compressed. 254e41f4b71Sopenharmony_ci 255e41f4b71Sopenharmony_ciPacking command example: 256e41f4b71Sopenharmony_ci 257e41f4b71Sopenharmony_ci``` 258e41f4b71Sopenharmony_cijava -jar app_packing_tool.jar --mode fastApp [--hap-path <path>] [--hsp-path <path>] --out-path <path> [--signature-path <path>] [--certificate-path <path>] --pack-info-path <path> [--pack-res-path <path>] [--force true] 259e41f4b71Sopenharmony_ci``` 260e41f4b71Sopenharmony_ci 261e41f4b71Sopenharmony_ci**Table 10** Parameters of the FastApp packing command 262e41f4b71Sopenharmony_ci 263e41f4b71Sopenharmony_ci| Name | Mandatory| Option | Description | 264e41f4b71Sopenharmony_ci|--------------------|-------|------------|-------------------------------------------------------------------------------------------------------| 265e41f4b71Sopenharmony_ci| --mode | Yes | fastApp | Packing mode. Each HAP file to pack into the APP file must pass the validity check. | 266e41f4b71Sopenharmony_ci| --hap-path | No | NA | Path of the HAP file directory, which contains all files of the HAP. If there are multiple HAP file directories, separate them with commas (,). | 267e41f4b71Sopenharmony_ci| --hsp-path | No | NA | Path of the HSP file. The file name extension must be .hsp. If there are multiple HSP files, separate them with commas (,). 2. Path of the HSP file directory, which contains all files of the HSP. If there are multiple HSP file directories, separate them with commas (,).| 268e41f4b71Sopenharmony_ci| --pack-info-path | Yes | NA | Path of the **pack.info** file. The file name must be **pack.info**. | 269e41f4b71Sopenharmony_ci| --out-path | Yes | NA | Path of the target file. The file name extension must be .app. | 270e41f4b71Sopenharmony_ci| --signature-path | No | NA | Path of the signature file. | 271e41f4b71Sopenharmony_ci| --certificate-path | No | NA | Path of the certificate file. | 272e41f4b71Sopenharmony_ci| --pack-res-path | No | NA | Path of the **pack.res** file. | 273e41f4b71Sopenharmony_ci| --force | No | true or false| The default value is **false**. If the value is **true**, an existing target file will be forcibly deleted during packing. | 274