| 28 | |
| 29 | The '''androiddeployqt''' makes it possible to create android packages (APK) for Qt applications from the command line. |
| 30 | |
| 31 | But before you can start using it, you need to export paths to your Android NDK & SDK as environmental variables so that the tools can find them: |
| 32 | |
| 33 | {{{ |
| 34 | export ANDROID_NDK_ROOT=<path to Android NDK top level folder> |
| 35 | export ANDROID_SDK_ROOT=<path to Android SDK top level folder> |
| 36 | }}} |
| 37 | |
| 38 | Note that the NDK should preferably be the same one that has been used for your Python 3 for Android build. |
| 39 | |
| 40 | Next you need to run ''qmake'' & ''make'' in your project directory to prepare it for '''androiddeployqt'''. |
| 41 | |
| 42 | Note that you should use the ''qmake'' that from your Qt for Android SDK, not the system-wide ''qmake'', so that any platform dependent code (C++ launcher, etc.) in your project is correctly compiled for Android. For example for the Qt 5.3 Android SDK on Linux installed in ''/opt'' this "android qmake" is in {{{/opt/Qt5.3/5.3/android_armv7/bin/qmake}}}. |
| 43 | |
| 44 | {{{ |
| 45 | qmake |
| 46 | make install INSTALL_ROOT=android-build/ |
| 47 | }}} |
| 48 | |
| 49 | Next run the tool to create an APK: |
| 50 | |
| 51 | {{{ |
| 52 | androiddeployqt --output android-build/ --verbose |
| 53 | }}} |
| 54 | |
| 55 | This is just a basic usage example, the tool can do much more such as deploying the APK to device, signing the AKC, using a different Qt library deploy methods, etc. |