本页内容

创建安卓软件包

要指定androiddeployqt 工具的设置,请访问Projects >Build Settings >Build Android APK 并选择Details

在 "项目 "的 "构建设置 "选项卡中构建 Android APK 步骤

androiddeployqt 工具会根据设置创建 APK。有关可用选项的更多信息,请参阅androiddeployqt

您可以在"编译输出"(Compile Output)中查看有关androiddeployqt 工具正在执行的操作的信息。要查看更多信息,请选择Verbose output

选择Add debug server ,将调试服务器二进制文件包含到软件包中。

选择 API 级别

Android build platform SDK 字段中,选择用于构建应用程序的API 级别。通常,应选择可用的最高 API 级别。

通常情况下,应使用最高版本的 Android SDK 构建工具进行构建。如有必要,请在Android build-tools version 字段中选择其他版本。

构建 AAB

要在本地测试应用程序,请使用 APK 格式,因为Qt Creator 可以在设备上安装和运行软件包。如需发布到 Google Play 商店,请选择Build Android App Bundle (*.aab) 创建 AAB。

使用 CMake 构建时,可以在Initial Configuration 中的CMake 部分查看所选的 ABI。您可以将其他 ABI 设置为ANDROID_ABI 关键字的值:

用于构建 AAB 的 CMake 设置

使用 Qbs 或 qmake 构建时,可在Build Steps 中的ABIs 字段选择 ABI:

用于构建 AAB 的 qmake 设置

编译 AAR

Build Steps 部分选择 AAR 目标。

选择 AAR 目标

另请参阅 如何:为 Android 开发》和《为 Android 开发》

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.