Select the Android Kit and ‘Debug’ mode, connect your Android Device or Emulator, then tap on ‘Projects’ Tab.
Android Build Debug Settings
If ‘Shadow Build’ is checked, the Build process will create a Build Directory and generate all the output there. Without this, all would be created inside your Project Dir – thisn’t recommended.
You can enable/disable QML Debugging
The Qt Quick Compiler should be set to ‘Leave at Default’ for Debug builds.
The Build Steps Details provide an important list of ABIs to be used. You can select one or more.
- 32 Bit ARM – armeabi-v7a
- 64 Bit ARM – arm64-v8a
- 32 Bit X 86
- 64 Bit X86
While debugging, I normaly only select one ABI, which matches the requirements of connected Android Device.
Build Android APK Details also are important.
For a Debug Build you don’t need to sign the app.
From a DropDown list you can select the Android Build Platform – in this case, API 31 is selected.
Building App Bundles isn’t needed for Debug – you only need them for Releases uploaded to Google Play Store.
If you check ‘Open package location after build’, QtC wil automagically open the Build Dir.
If verbose output is set, you’ll see much more logging statements, which sometimes helps to fix an issue.
As last part you can check ‘include prebuilt OpenSSL libraries – QtCreator then will automatically insert the ‘include’ at the bottom of the .pro file.
Create Android Templates
For each new Project or every time you update to a new Qt Version, you should create/update Qt Android Templates. (See Button above)
All about Qt Android Templates in detail you’ll find here.
Android Build Release Settings
The Release Build Settings are similar to Debug Settings, but you should enable QtQuickCompiler.
In Release Build Steps you should select the architectures your app should target. This can be one, if building an APK for a specific architecture only, or more to be contained into one APK or in an App Bundle (*.aab). Read more about ‘Build multi arch APK / App Bundles’ below.
In Release Build APK Details you must tell qmake where to find the keystore or create a new one. Then check ‘Sign package’ and enter the password.
Under ‘Advanced Actions’ you can check if an App Bundle or APK is needed. If checking ‘App Bundles’, the .aab and also an APK containing all architectures will be build. You only need App Bundles if you want to upload your app to Google Play Store.
Build multi arch APK / App Bundles
I’m debugging on 32-Bit and 64-Bit Devices, so I need
- armeabi-v7a APK
- arm64-v8a APK
This is easy to select in the settings.
For my customers I need different Release Builds.
For some of them it’s easy – they distribute the apps in-house only using one or all APKs for
- armeabi-v7a APK
- arm64-v8 APK
- x86-64 APK
If customers deploy apps via Google Play Store, then I don’t need APKs but App Bundles (.aab) containing all architectures in one bundle.
You can do all this stuff directly from QtCreator simply checking/unchecking some boxes.
Android Run Settings
Run Settings allow you to add Command Line Arguments as well as Activity Manager arguments and Shell Commands.
Shell Command for Business Users
Here’s an example where you have to deploy/run the app on a business device, where private use and business use are separated by two users: User 0 (private) and normally User 10 (Business).
In this example we start the App with
--user 10 – also Shell commands to always switching to the Business User at start and switching back to Private User after quitting the App. ADB command
input keyevent 82 unlocks the Android Device Screen.
Android Manifest (QtWS)
If not already done, you should set the Application Name, Activity Name and the Package Name.
Important: For QtQuickControls Apps, the Style extraction must be set to ‘minimal’.
Build, deploy and run the App
Now we can Run the App on selected Device.
If all works well, you should see the App on your Test Device:
Go on with Android App Signing
You must be logged in to post a comment.