-
Notifications
You must be signed in to change notification settings - Fork 753
Deploying Linux to Android
There are two ways to deploy from Linux to Android, using docker image or using Android SDK. Before you deploying your app, you might want to prepare keystore for signing your APK.
This method is more recommended because it's easier and doesn't require you to install additional packages on your system.
-
Make sure you already installed
dockeron your system. -
Pull docker image for Android :
docker pull therecipe/qt:android -
Deploy your app :
qtdeploy -docker build android
Once the deployment finished, you can start your application by running the APK file that located in folder deploy/android/build at your project's root directory.
You might want to use this method if you are planning on using the latest version of Qt and Android SDK.
-
Make sure you already installing this binding using Qt5 official installer.
-
Download Android SDK (with or without Android Studio) then extract it to
$HOME/android-sdk-linux/. You can also define custom location for Android SDK by modifying the value ofANDROID_SDK_DIRin environment variables. -
Install Android build tools and platforms by using SDK Manager that located in
$HOME/android-sdk-linux/tools/android. -
Download Android NDK then extract it to
$HOME. You can also define custom location for Android NDK by modifying the value ofANDROID_NDK_DIRin environment variables. -
Download Java Development Kit 8 then extract it to
$HOME/jdk. You can also define custom location for JDK by modifying the value ofJDK_DIRin environment variables. -
If you haven't done it before, run
qtsetup:qtsetup full android -
Deploy your app :
qtdeploy build android
Once the deployment finished, you can start your application by running the APK file that located in folder deploy/android/build at your project's root directory.
If you want to have your *.apk signed automatically, then you need to create an alias.txt, password.txt and an project_name.keystore inside the android folder at your project's root directory :
project_name
└── android
├── alias.txt
├── password.txt
└── project_name.keystore
After that, you can use qtdeploy like usual and it will automatically sign your APK.