Get executable output from Qt project with arm64-v8a compiler

12 views
Skip to first unread message

morteza ali Ahmadi

unread,
Mar 27, 2020, 4:32:59 PM3/27/20
to android-qt
Hi, I have a Qt console application project which I have compiled with arm64-v8a and I can install and run the outputed apk on my Android device without any problem.

I want to know what commands should I add to *.pro file to get the executable output? Instead of running apk on my Android device, I want to run the executable output of my project in adb shell of my Android device using

    ./myExecutableFile



command. I can see the *.so file of my application but there is no executable output and also adding template to *.pro does not effect:

    TEMPLATE = app



This is my *. pro:
   
   
QT -= gui
   
    CONFIG
+= c++11 console sql serialport network
    CONFIG
-= app_bundle
   
   
# The following define makes your compiler emit warnings if you use
   
# any Qt feature that has been marked deprecated (the exact warnings
   
# depend on your compiler). Please consult the documentation of the
   
# deprecated API in order to know how to port your code away from it.
    DEFINES
+= QT_DEPRECATED_WARNINGS
   
   
# You can also make your code fail to compile if it uses deprecated APIs.
   
# In order to do so, uncomment the following line.
   
# You can also select to disable deprecated APIs only up to a certain version of Qt.
   
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
   
    DEFINES
-= INCLUDE_CPUID
   
   
# Default rules for deployment.
    qnx
: target.path = /tmp/$${TARGET}/bin
   
else: unix:!android: target.path = /opt/$${TARGET}/bin
   
!isEmpty(target.path): INSTALLS += target
   
    LIBS
+= -L$$PWD/../../../Qt5.12.7/5.12.7/android_arm64_v8a/lib/ -lQt5SerialPort -lQt5Sql -lQt5Network
   
    INCLUDEPATH
+= $$PWD/../../../Qt5.12.7/5.12.7/android_arm64_v8a/include
    DEPENDPATH
+= $$PWD/../../../Qt5.12.7/5.12.7/android_arm64_v8a/include
    INCLUDEPATH
+= $$PWD/../../../Qt5.12.7/5.12.7/android_arm64_v8a/include/QtSql
    DEPENDPATH
+= $$PWD/../../../Qt5.12.7/5.12.7/android_arm64_v8a/include/QtSql
    INCLUDEPATH
+= $$PWD/../../../Qt5.12.7/5.12.7/android_arm64_v8a/include/QtNetwork
    DEPENDPATH
+= $$PWD/../../../Qt5.12.7/5.12.7/android_arm64_v8a/include/QtNetwork
   
    INCLUDEPATH
+= $$PWD
    DEPENDPATH  
+= $$PWD
    SOURCES
+= \
            initialization
.cpp \
            main
.cpp
    HEADERS
+= \
            initialization
.h



It may be necessary to change the qmake call too, so I put it here:

    /home/***/Qt5.12.7/5.12.7/android_arm64_v8a/bin/qmake /home/***/myProject/project.pro -spec android-clang CONFIG+=qtquickcompiler && /home/***/Android/Android/Sdk/ndk-bundle/prebuilt/linux-x86_64/bin/make qmake_all



I am using

 - java-8-openjdk-amd64
 - SDK Version: 25.2.5
 - NDK Version: 20.0.5594570 
 - Clang Qt 5.12.7 (android_armv64_v8a)
Reply all
Reply to author
Forward
0 new messages