Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Guide for debugging Qt-Android apps on your mobile device in Linux
Forum Updated to NodeBB v4.3 + New Features

Guide for debugging Qt-Android apps on your mobile device in Linux

Scheduled Pinned Locked Moved Mobile and Embedded
5 Posts 3 Posters 6.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    pivonroll
    wrote on 4 Sept 2011, 11:51 last edited by
    #1

    Hello all, this is my first post here so I'll try to keep it as simple as possible.
    Recently I wanted to try debugging my android app written in Qt using my Samsung Galaxy Ace and not the Android emulator.

    Steps to do this are as follows:

    1. Run lsusb | grep Samsung (if you use let's say HTC device just type HTC instead of Samsung after "grep"). You will see something like this: Bus 001 Device 003: ID 04e8:689e Samsung Electronics Co., Ltd GT-S5670 [Galaxy Fit]
      Bolded numbers are of a key value to get your android device propely recognized.

    2. Now make a fule 51-android.rules in the /etc/udev/rules.d/ directory. The number 51 is an information to udev so it can know in which order to load the rules. You can type some other number if you already had some rules defined, but keep in mind the order in which those rules will be applied.

    3. In the file 51-android.rules input this: SUBSYSTEMS==”usb”, ATTRS{idVendor}==”04e8″, ATTRS{idProduct}=="689e", MODE=”0666″. If you take a closer look you will see that we used bolded numbers from step 2 so that we can make our rule apply only to our device. So the first number 04e8 is a ID of a vendor of the device (in this case vendor is Samsung), and the second number 689e is the ID of the product (in this case product is a GT-S5670 which is a designation of Samsung Galaxy Ace mobile device). MODE="0666" just tells that the node that udev will create should be readable and writable by everyone.

    4. After you have saved the file, run this command in order to reload udev's rules: udevadm control --reload-rules

    5. After you have reloaded the udev's rules, you need to restart adb. Go to the folder where you keep your android SDK. Go to the folder platform-tools inside the android SDK directory and run: adb kill-server and after that adb start-server (NOTE: if you get command not recognized error, just run those commands like this: ./adb kill-server and ./adb start-server). This will reload adb server and it should now list your device, just run adb devices and if you see something like this:
      List of devices attached
      S5830cba628dc device

    Then your device is properly recognized.
    Now you are set and ready. Next time you hit Run button in Qt-Creator your app wil load on your mobile device.
    NOTE: In some cases you will need to restart your system in order to get your device recognized, but it will work without restarting in most cases.

    1 Reply Last reply
    0
    • L Offline
      L Offline
      leon.anavi
      wrote on 6 Sept 2011, 08:34 last edited by
      #2

      Welcome and thanks for the post :) If is always great to read new info about Qt on Android.

      You should consider creating a new "wiki":http://developer.qt.nokia.com/wiki article about this topic as "Qt Dev Net wiki":http://developer.qt.nokia.com/wiki is far more appropriate for sharing solutions and how-to :)

      10x,
      Leon

      http://anavi.org/

      1 Reply Last reply
      0
      • P Offline
        P Offline
        pivonroll
        wrote on 6 Sept 2011, 08:43 last edited by
        #3

        Thanks for your replay, I will try to create a wiki article, about this, this week.

        1 Reply Last reply
        0
        • A Offline
          A Offline
          Alicemirror
          wrote on 6 Sept 2011, 15:58 last edited by
          #4

          Leon has anticipated me, I suggest the same. BTW, thank you for the post, this is exactly what I was searching to understand.

          Enrico Miglino (aka Alicemirror)
          Balearic Dynamics
          Islas Baleares, Ibiza (Spain)
          www.balearicdynamics.com

          1 Reply Last reply
          0
          • P Offline
            P Offline
            pivonroll
            wrote on 10 Jun 2012, 15:05 last edited by
            #5

            I created the wiki, sorry it took me so long to do it, i totally forgot about it.
            "How to debug Qt-Android apps on your mobile device under Linux":http://qt-project.org/wiki/How_to_debug_Qt_applications_on_Android_device

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved