Qt creator комплекты android

Qt Documentation

Contents

Installing the Prerequisites

In order to use Qt for Android, you need the following:

    Java Development Kit (JDK) provided by AdoptOpenJDK for all platforms, is required to build Android apps. Other alternatives such as OpenJDK for Linux or Java SE Development Kit for Windows are also supported.

Note: JDK 11 or earlier must be used when using Qt for Android.

Gradle for building application packages (APK) and app bundles (AAB) for Android devices. Gradle is delivered with Qt 5.9, and later.

Note: Using Ant to build APKs is no longer supported.

  • The Android Command-line SDK Tools to install the following packages that are required to compile Qt applications for Android:
    • Platform tools
    • Build tools
    • At least one SDK platform
    • The Android NDK, which contains toolchains and debuggers for Android.

    Note: Qt Creator 4.12 or later can set up the SDK Tools, NDK, and essential packages automatically. For more information, see Qt Creator: Specifying Android Device Settings.

    Note: If you are using the SDK Tools 26.x or below, the JDK 8 is required. Versions higher than 8 might cause issues for the Android SDK tools.

    Note: If your Qt version is earlier than v5.9, use the SDK tools package v25.2.5 or earlier.

  • The Android NDK can be installed using the sdkmanager tool. Alternatively, you can download it and extract it manually to a path of your choosing.
  • Different Qt versions depend on different NDK versions, as listed below:

    Qt version NDK version Toolchain
    Qt 5.14.0 or later Qt 5.13.2 or later Qt 5.12.6 or later NDK r20b or r21 android-clang
    Qt 5.12.0 to 5.12.5 Qt 5.13.0 to 5.13.1 NDK r19c android-clang
    Qt 5.11 and earlier NDK r10e GCC toolchain

    Note: Qt 5.14.0 and 5.14.1 with NDK r21 have a bug fixed at QTBUG-81461.

    Note: Make sure to unpack the Android SDK and NDK to a writeable location that Qt Creator can access later. Otherwise, Qt Creator won’t be able to use sdkmanager or find all components even if they were installed manually.

    Installing the Android SDK Essentials

    After downloading and unpacking the Commandline SDK Tools, use the sdkmanager command line tool to install the essential packages:

    Android Studio or the Qt Creator’s SDK Manager UI can also be used to install the essential SDK packages.

    To use the Android Emulator, install it by entering:

    Host Specific Configuration

    Windows

    The default USB driver on Windows does not allow debugging using Android Debug Bridge (ADB) tool. You must install the additional USB driver provided by the extras Android SDK package. To install it, run the following:

    After the package installation is complete, install the driver from /extras/google/usb_driver . Try running a few basic adb commands now and check whether your Android device responds to them.

    Linux 64-bit

    If you’re developing on a 64-bit Linux machine, you must install the following dependencies in order to run 32-bit executables like adb , which allows Qt Creator to find devices to deploy to:

    To run the Android emulator, the following dependencies are also necessary:

    Qt Creator IDE

    The Qt Creator IDE can be used to develop Qt applications for Android. For more information, see Qt Creator: Connecting Android Devices.

    Testing Your Setup

    Now you can test your development setup by running the examples shipped with the Qt installation. For more information, see Qt for Android Examples.

    To develop a simple application from scratch, see Qt Creator: Creating a Mobile Application.

    В© 2021 The Qt Company Ltd. 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.

    Источник

    Qt Documentation

    Contents

    You can connect Android devices to the development PC using USB cables to build, run, debug, and analyze applications from Qt Creator. Devices with Android version 4.1 (API level 16) or later are supported when developing with Qt 5 and devices with Android version 6.0 (API level 23) when developing with Qt 6.

    To develop for Android, you must have a tool chain for building applications for Android devices installed on the development PC. Qt Creator can automatically dowload and install the tool chain and create a suitable build and run kit that contains the tool chain and the Qt version for Android for the device’s architecture.

    Starting from Qt 5.14.0, the Qt for Android package contains all the architectures (ABIs) installed as one.

    To enable helpful code editing features for Java, such as code completion, highlighting, function tooltips, and navigating in code, specify settings for a Java language server.

    The Android Debug Bridge (adb) command line tool is integrated to Qt Creator to enable you to deploy applications to connected Android devices, to run them, and to read their logs. It includes a client and server that run on the development host and a daemon that runs on the emulator or device.

    Requirements

    To use Qt Creator to develop Qt applications for Android, you need Qt for Android 5.2, or later, and the tool chain that Qt Creator can automatically download, install, and configure for you. For more information, see Installing the Prerequisites.

    Specifying Android Device Settings

    Qt Creator offers to automatically install all the necessary packages and tools and to set up your development environment by creating debuggers, tool chains, and kits. You can use Qt Creator to:

    • Download and extract the Android SDK Command-line Tools.
    • Install or update the essential packages such as NDKs, build tools, and platform tools.

    To set up the development environment for Android:

      Select Tools >Options >Devices >Android on Windows and Linux or Qt Creator >Preferences >Devices >Android on macOS.

    In the JDK location field, set the path to the JDK. Qt Creator checks the JDK installation and reports errors.

    By default, Qt Creator tries to find a supported AdoptOpenJDK or OpenJDK installation. If none is found, you must set the path manually. If you don’t have a supported JDK installed, select to open the JDK download web page in the default browser.

    Note: We recommended using a 64-bit JDK, because the 32-bit one might cause issues with cmdline-tools , and some packages might not be listed.

    The SDK Manager checks whether the tool chain is installed. If packages are missing or updates are needed, the SDK Manager offers to add or remove those packages. Before taking action, it prompts you to accept the changes it is about to make. In addition, it prompts you to accept Google licenses, as necessary.

  • The installed NDK versions are listed in Android NDK list. The locked items were installed by the SDK Manager, and can only be modified from the SDK Manager tab. For more information, see Managing Android NDK Packages.
  • In the Android OpenSSL group, set the path to the prebuilt OpenSSL libraries.

    For Qt applications that require OpenSSL support, Qt Creator allows to quickly add the Android OpenSSL support to your project. For more information, see Adding External Libraries.

  • Select Download OpenSSL to download the OpenSSL repository to the selected path. If the automatic download fails, the download web page opens for manual download.
  • Select the Automatically create kits for Android tool chains check box to allow Qt Creator to create the kits for you. Qt Creator displays a warning if it cannot find a suitable Qt version.
  • Manual Setup

    Note: We recommend that you use the latest Android SDK Command-Line Tools. Using Android SDK Tools version 25.2.5 or earlier is not supported, because they cannot be fully integrated with Qt Creator.

    However, if the automatic setup does not meet your needs, you can download and install Android SDK Command-line Tools, and then install or update the NDKs, tools and packages needed for development. For more information, see Getting Started with Qt for Android.

    Viewing Android Tool Chain Settings

    The Android SDK Command-Line Tools download URL, the essential packages list, and the appropriate NDK for each Qt version are defined in a JSON configuration file. The file is located under the user’s Qt Creator resource folder:

    For example, the SDK configuration file defines the NDK version 19.2.5345600 to be used for Qt 5.12.0 to 5.12.5 and Qt 5.13.0 to 5.13.1 versions:

    You can view the latest version of the configuration file that is up-to-date with the Android SDK and NDK changes, sdk_definitions.json, in Git.

    Managing Android NDK Packages

    To view the installed Android NDK versions, select Tools > Options > Devices > Android on Windows and Linux or Qt Creator > Preferences > Devices > Android on macOS.

    The locked versions were installed by the SDK Manager, and can only be modified from the SDK Manager tab. For more information, see Managing Android SDK Packages.

    To manually download NDKs, select .

    To add custom NDK paths manually to the global list of NDKs, select Add. This creates custom tool chains and debuggers associated to that NDK. However, you have to manually create a kit that uses the custom NDK. For more information, see Adding Kits.

    Managing Android SDK Packages

    Since Android SDK Tools version 25.3.0, only a command-line tool, sdkmanager, is provided by Android for SDK package management. To make SDK management easier, Qt Creator provides an SDK Manager for installing, updating, and removing SDK packages. You can still use sdkmanager for advanced SDK management.

    To view the installed Android SDK packages, select Tools > Options > Devices > Android > SDK Manager on Windows and Linux or Qt Creator > Preferences > Devices > Android > SDK Manager on macOS.

    To filter the packages, select Available, Installed, or All in Show Packages.

    To update the installed Android SDK packages, select Update Installed. Select the packages to update, and then select Apply.

    To specify advanced sdkmanager settings, select Advanced Options and enter arguments in the SDK Manager arguments field. The available arguments are listed and described in Available arguments.

    Managing Android Virtual Devices (AVD)

    The available AVDs are listed in Tools > Options > Devices on Windows and Linux or Qt Creator > Preferences > Devices > on macOS. You can add more AVDs.

    You can see the status of the selected device in Current state. To update the status information, select Refresh.

    To start an AVD, select Start AVD. Usually, you don’t need to start AVDs separately because they are automatically started when you select them in the kit selector to deploy applications to them.

    To remove an AVD from the list and the kit selector, select Erase AVD.

    To specify options for starting an AVD, select AVD Arguments.

    Specify the options in Emulator command-line startup options. For available options, see Start the emulator from the command line.

    Note: The Android Emulator has a bug that prevents it from starting on some systems. If an AVD does not start, you can try starting it manually by running the following commands:

    Creating a New AVD

    To create new virtual devices:

      Select Tools >Options >Devices >Add >Android Device on Windows and Linux or Qt Creator >Preferences >Devices >Add >Android Device on macOS to open the Create New AVD dialog.

  • Set the name, definition, architecture, target API level, and SD card size of the device.
  • Select OK to create the AVD.
  • For more advanced options for creating a new AVD, use the command-line tool avdmanager or the Android Studio’s native AVD Manager UI.

    Debugging on Android Devices

    Debugging is enabled in different ways on different Android devices. Look for USB Debugging under Developer Options. On some devices Developer Options is hidden and becomes visible only when you tap the Build number field in Settings > About several times. For more information, see Configure on-device developer options.

    Select a debug build configuration to build the application for debugging.

    Note: Qt Creator cannot debug applications on Android devices if Android Studio is running. If the following message is displayed in the Output pane, close Android Studio and try again:

    В© 2021 The Qt Company Ltd. 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.

    Источник

    Читайте также:  Снять дамп прошивки android
    Оцените статью