Qt World Summit: Submit your Presentation

Deploy Android application to physical device

  • Hi all,

    first I want to tell that I like the way Qt is developing. Especially the Android development.

    I have a problem with deploying my app to my Galaxy S2. Two days ago I made a simple GUI and was able to build AND deploy it on my S2. It worked like a charm. But now, I don't know what happened, I can ONLY deploy on a AVD. How can I tell Qt to deploy on my S2? If I cancel the AVD request I get this following error: When executing step 'Deploy to Android device.
    I get this error on my Ubuntu and Windows7 machine. I downloaded the 5.1beta with android.

    My adb connection is available and running. It is very frustrating, I need to know where the problem is.
    Device type :android device.
    compiler : Android gcc(arm-4.4.3)
    qtVersion:Qt 5.1.0(qt5) for Android armv7

  • Moderators

    Maybe your phone is not in developer mode? Have you changed any settings, like permission to install app from 3rd part sources etc.?

  • I get a similar problem with Qt 5.1beta on my linux machine.
    This is what happens to me:

    the android device is not connected to my machine

    I open the project with Qt creator

    I run the debug and the simulator appear, and I test the application

    I connect the device to my machine

    and everytime I run the app from Qt Creator the simulator appear instead of running of the device

    I solved it doing the following when I want to test the app on a real device:

    close all instances of Qt Creator and android simulator

    first connect the device to the machine

    re-open Qt creator and load the project

    run the app... and now it will run on the real device

    And looked for a way to instruct Qt Creator which device to use for run the debug... but I didn't find. So, now this is my best practice.

    I hope it helps to you,

  • I am very sure that my phone is in developer mode. Otherwise I couldn't made contact via adb. Permissions settings for installing from third party apps is ok.

  • @Gianluca,

    I tried your solution but it didn't help. Qt still asks me make a AVD. Sometimes, the error "Could not run adb. No device found." pops up in the Compile output. But my ADB server tells me that the devices has been found ("adb devices").

    The project builds fine without any errors. With Eclipse I can successfully create and run a simple HelloWorld project. When I create a simple GUI application in Qt5.1 and deploy it onto Android it just doesn't work.

  • I solved it,

    It was a driver problem. ADB did recognize my S2, but Qt wouldn't deploy.
    I removed all Android drivers, re-installed official Samsung Android driver and now it's fully up and working ;-)

  • I don't what happened, but now it isn't working anymore.
    I tried to start-up my VirtualBox with Ubuntu and Qt5.1b for Linux has exactly the same problem.

    I have two HDD with each an another version of Windows. I installed Qt5.1(windows) and again, the same problem occurred.
    All kind of project builds fine without any erros, but when it has to be deployed it is getting stuck by calling ADB.exe. In taskmanager I saw that two instances of ADB.exe has been called. When I force to close one instance, Qt become alive and asks me to create an AVD!?

    The most strangest thing of all is, when I try to install exact the same Qt5.1 install file and run it on another laptop, it does work!

    So I can tell now that it is definitely my laptop. Who can tell me what to do???

  • I have a solution for my problem. Since Qt is crashed when I hit RUN, many instances of ADB.exe were running.

    I made this little bash script.

    echo "HI, $USER! Android deploy script by Eric Steendijk"
    sleep 2
    echo "Building project with WinAT"

    ant clean debug
    sleep 2
    echo "ANT complete"

    echo "ADB Uninstall project from target"
    adb -s 001912536ca18e uninstall org.qtproject.example.ipactest
    echo "ADB Uninstall finished"
    sleep 1
    echo "ADB Install project on target"
    adb -s 001912536ca18e install ./bin/IPAC-debug.apk
    sleep 1
    echo "ADB Install finished"

    So now I am able to develop again!
    To make this working I have to start-up qt. Push build, not run, and let it make the build.xml. After that just click the bash file and it deploys well on the phone.

  • Adding my Experience.
    I was having the similar problem, where QT Creator was always starting the simulator.
    The problem in my case was,
    Android Device – Settings – About Device – Android version - 4.1.2
    But the settings for Project i.e.
    QTCreator - Projects – Android Run configuration – package configuration – mainfest – Android target SDK - API 17.
    I changed it to API 16.
    It started the debugging on Device.
    ( I had already set the device for "Developer options" and
    I had also installed the USB driver for windows for the device. )

Log in to reply