Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-128298

QT_ANDROID_DEBUGGER_MAIN_THREAD_SLEEP_MS doesn't work

    XMLWordPrintable

Details

    • Android
    • e8a35410c (dev), 03bf2cba3 (6.8), b508ad6c3 (6.7)
    • 2024wk34s2FOQtforAndroid

    Description

      I understand why the 5 seconds delay has been introduced to the Android applications startup. Debuggers are nice.
      But the simple fact is that now, every single application has a 5 seconds white screen before even starting to load...

      As per instructions read directly from the console output, it looks like I can set QT_ANDROID_DEBUGGER_MAIN_THREAD_SLEEP_MS to 0 in my environment variables. Yay! And that even works!
      But in fact, that doesn't work. Not in real life. When an application is launched from the phone, setting the variable with a qputenv from the main() does nothing, it's likely too late to be picked up by the QtActivityLoader.java? Or is there something I'm missing entirely? (making the following rant unwarranted)

      I'm a developer. But I actually use the applications that I'm creating. I know, right?
      Sometimes even I show them to people. The 5s white screen is real classy, and a good display of my skill set

      Then just run release build on my phone, why not? No 5s delay then!
      I'm a developer. I don't usually "just" run release build...

      Release builds are pure pain since they started requiring a "real" signing key to work a while back (the reason why I never read anywhere, by the way). Before that, they could be signed with the same default key generated on your computer (or whatnot), and we could just switch on the fly between debug and release, that was good enough. Not great if you have two computers, but that's another problem entirely.
      Now with real signing keys, we have to go to the project panel, build APK section, make sure we are in fact editing the RELEASE build configuration (or do this whole thing again), make sure a key is set (which reset every time you change kit) or take a minute exploring our folders in search of the right key, then enter our passkey (which should be more than a few characters, do you see where I'm going with that? I can remember mine, which is not short, but if a client has a random 256 characters key... that's another minute lost).

      And do this every time you switch between projects. Which I do a lot.
      And do this every time you switch between kits. Which I do a fair amount of time in a day too.
      And do this every time Qt Creator crash. Which it does a lot.

      And we end up with a release build that starts fast. Faster even. Great. And that has no traces, and is incompatible with the debug build (because they don't have the same signing key) so we need to reinstall. And lose everything, settings, permissions, data... I have an application with 6 months of data logging. I'm not reinstalling that every day.

      Now, we are in a bit of a situation. The 5s delay is just dreadful. Avoiding the 5s delay by going the release build way is just not gonna cut it. Signing every debug build (to avoid the reinstallation when switching between debug/release) would waste even more time day to day. Not using Qt 6.7+ would be possible, if only 6.6 wasn't riddle with Android game breaking bugs.

      In fact, the only solution that I see would be to do the opposite with QT_ANDROID_DEBUGGER_MAIN_THREAD_SLEEP_MS. Set it to 0 by default, and having Qt Creator set it to 5s for everyone. I don't mind having applications I'm developing starting 5s late when plugged to my computer. I really really really care having an application I'm using starting 5s late.

      Having the apk signing workflow "fixed", or vastly improved really, would also be nice, but would still feel like a band-aid regarding today's problem. Switching from debug to release for every app I touch in a day, at the end of the day... Not ideal...

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            assam Assam Boudjelthia
            emeric Emeric Grange
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes