Deploying Linux to Android - therecipe/qt GitHub Wiki
Docker deployment
-
Install Docker: https://store.docker.com/search?offering=community&type=edition or using a package manager
-
If necessary run docker as root
-
Pull the target image
docker pull therecipe/qt:android
- Deploy your application
qtdeploy -docker build android
or
qtdeploy -docker build android-emulator
You should find your deployed application inside the deploy
subfolder.
Regular deployment
- Install the [official version of Qt](/therecipe/qt/wiki/Installation-on-Linux#official-version-with-android-support)
- Download the Android SDK: https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip
- Extract the Android SDK tools to
$HOME/android-sdk-linux/tools
If you have to, you can also define a custom location with ANDROID_SDK_DIR
- Use the Android sdkmanager to download the necessary dependencies
$HOME/android-sdk-linux/tools/bin/sdkmanager "platform-tools" "build-tools;28.0.3" "platforms;android-28"
- Download the Android NDK: https://dl.google.com/android/repository/android-ndk-r18b-linux-x86_64.zip
- Extract the Android NDK to
$HOME
If you have to, you can also define a custom location with ANDROID_NDK_DIR
-
Install the Java Development Kit: https://adoptopenjdk.net/index.html?variant=openjdk8; If you have to, you can also define a custom location with JDK_DIR
-
If you haven't already, run the setup for android
qtsetup full android && qtsetup full android-emulator
- Deploy your application
qtdeploy build android
or
qtdeploy build android-emulator
You should find your deployed application inside the deploy
subfolder.
Signing your application
If you want to have your *.apk
signed automatically, then you just need to create an jks_alias
, jks_pass
and an project_name.jks
inside the android
or android-emulator
subfolder of your project's root directory.
project_name
├── android
│ ├── project_name.jks
│ ├── jks_alias
│ └── jks_pass
└── android-emulator -> ./android/
qtdeploy
will then automatically build in release mode and sign your *.apk
with the provided keystore using the credentials from within jks_alias
and jks_pass
You can find more info about app signing and how to create a *.jks
keystore here
You can also find a working example here