对 HarmonyOS 包进行签名

HarmonyOS 设备仅安装已签名的包,因此签名材料不可或缺。该签名材料是针对开发者账户签发的,无法在本地生成。

  1. 请访问Preferences >SDKs >HarmonyOS >Package Signing 。
  2. 将Certificate (.cer) 、Provisioning profile (.p7b) 、Keystore (.p12) 和Key alias 设置为该账户生成的值。
  3. 输入Key password 和Keystore password 。Qt Creator 会将它们保存在系统钥匙串中。这些值也可以作为环境变量QT_HARMONYOS_SIGNING_KEY_PASSWORD 和QT_HARMONYOS_SIGNING_STORE_PASSWORD 传递,这是构建机器通常的做法。只有密码会回退到环境变量,因此其余四个值必须在此处设置。

Qt Creator 在打包前会读取配置文件,并将其中可见的内容作为问题报告:

  • 它会使用配置文件指定的包名进行打包,当该包名与项目要求的包名不一致时会予以提示。
  • 它会将配置文件中未列出的受限权限移至 `allowed-acls` 目录下——否则设备会因这些权限而拒绝整个包——并列出这些权限的名称,以便将其添加到配置文件中。
  • 它会报告有效期已过或尚未生效的配置文件。
  • 报告设备 UDID 未在配置文件中列出的情况,而调试配置文件正是通过该 UDID 进行安装的。

另请参阅 《HarmonyOS 设备开发指南》、《HarmonyOS 开发入门》以及《配置 HarmonyOS SDK》。

Copyright © The Qt Company Ltd. and other contributors. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.