Use the mppm tool

更新时间:
复制 MD 格式

mppm is an SDK management tool from mPaaS. You can use it to clear dependency caches, install dependencies, and generate initialization code.

Install the mppm tool

npm install @alipay-inc/oh-mpaas-cli -g

Check the tool version

mppm --version

The current version of the tool is v2.0.2.

Clear the HarmonyOS project cache

mppm clean

This command clears the hvigor cache and the cache in the oh_modules folder. After the command completes, run sync and ohpm install again.

Install HarmonyOS dependencies

mppm install 

This command runs ohpm install for each module.

Generate a security image

mppm fetch-image --finger xxxxxx --secret xxxx

The --finger and --secret options are used to configure the signature and appsecret. If you specify these options, the image generation process will fail. After the data is successfully pulled, the image is placed in the rawfile directory under the entry directory.

Options

  • --finger: Configures the fingerprint.

  • --secret: Configures the appsecret.

  • --pack: Configures the package name. This option is not required. By default, the package name is read from the app.json5 file in the project.

  • --appid: Specifies the appid. This parameter is optional. By default, the appid is read from the mpaas.config file.

  • --workSpaceId: Specifies the workSpaceId. This parameter is optional. By default, its value is read from the mpaas.config file.

Upgrade the baseline

mppm upgrade

This command upgrades the current baseline to the latest version. During the upgrade, you are prompted to install or uninstall SDKs. For more information, see Initialize the project.

Install components

mppm sdk

Use this command to install the baseline SDK after mPaaS initialization is complete. The command switches your project to the latest baseline version. During this process, you are prompted to install or uninstall SDKs. For more information, see Initialize the project.

Options

--custom: Uses a custom baseline. Specify the custom baseline version after this option.

Example

mppm sdk --custom 10.2.3.isec

Synchronize the baseline

mppm sync

This command synchronizes the SDK. Use this command after you manually modify the baseline version. After mppm init runs, the .mprc configuration file is automatically generated.

image

After you modify this file, run mppm sync to refresh the project dependencies to match the baseline version specified in the .mprc file. This process does not prompt you to install SDKs.