Sign up for the KDAB Newsletter
Stay on top of the latest news, publications, events and more.
Go to Sign-up
While I was working on a yet-to-be-announced super secret and cool Qt on Android project, I had to do a lot of debugging. This way I found that debugging Qt apps on Android using QtCreator was ok, but it had some issues, which was kinda frustrating.
Long story short, these problems will be fixed starting with QtCreator 4.6.1 (was too late for 4.6.0) or 4.7, and I also paved the way for using lldb if necessary, though, gdb works perfectly for me. And in the (distant) future MAYBE even being able to do java debugging from QtCreator as well!
Keep reading if you are interested in technical details.
How the debugging worked until now: it used a handshake technique:
How it works now: it's using the same technique that Android Studio uses:
At first glance, both ways look similar, but .... there is a big difference :)
The downside of the new way is that the start up is a little bit slower, because instead of loading the symbols for all the .so files at once, it will load them one by one as they are loaded by the application, which on my Ryzen 1700X is from 2 to 5 seconds slower.
If you can't wait for QtCreator 4.6.1/4.7 you can cherry-pick the following two patches and rebuild QtCreator yourself:
In the end I want to thank The Qt Company folks who helped me in testing these patches on all platforms and on as many devices as we had!
About KDAB
The KDAB Group is a globally recognized provider for software consulting, development and training, specializing in embedded devices and complex cross-platform desktop applications. In addition to being leading experts in Qt, C++ and 3D technologies for over two decades, KDAB provides deep expertise across the stack, including Linux, Rust and modern UI frameworks. With 100+ employees from 20 countries and offices in Sweden, Germany, USA, France and UK, we serve clients around the world.
Stay on top of the latest news, publications, events and more.
Go to Sign-up
Upgrade your applications from Qt 5 to Qt 6 with KDAB’s migration services. Get a free migration assessment and join a hands-on workshop to prepare your team for a successful transition!
Learn more
4 Comments
20 - Apr - 2018
Jean-Michaël Celerier
Thanks, debugging on android really worked 20% of the time previously in my experience !
20 - Apr - 2018
scdevelop
Hi BogDan, sorry for the off-topic but I know you are the master of Qt for Android and maybe can help with this. I opened this bug couple of months ago: https://bugreports.qt.io/browse/QTBUG-65894 I think it is rather important but unfortunately it did not receive any attention. I hope you can take a look at it or at least give it a boost. Thanks for your hard work and advice on Qt for Android!
27 - Feb - 2019
Chris
I'm using Qt Creator 4.9.0-beta1 (Build Date = Feb 20 2019), on Ubuntu 16.04, Qt 5.12.1, NDK 19.1, Android SDK 26.1. I can Build and Run apps for Android but I've never been able to get debugging to work. I keep getting the error: The command ".../Android/Sdk/platform-tools/adb" terminated with exit code 1.error: listener 'tcp:5039' not found
What configuration do you develop with to get debugging to work (Qt Creator version, OS, Android SDK, NDK)?
27 - Feb - 2019
BogDan Vatra
I didn't tried yet QtCreator 4.9-beta1. QtCreator 4.8.1 should work perfectly. Please use https://bugreports.qt.io to report your problem.