diff --git a/src/corelib/Qt6AndroidMacros.cmake b/src/corelib/Qt6AndroidMacros.cmake index 252332676b8..903611f0481 100644 --- a/src/corelib/Qt6AndroidMacros.cmake +++ b/src/corelib/Qt6AndroidMacros.cmake @@ -430,6 +430,13 @@ function(qt6_android_add_apk_target target) endif() if(QT_ANDROID_DEPLOY_RELEASE) list(APPEND extra_args "--release") + elseif(NOT QT_BUILD_TESTS) + # Workaround for tests: do not set automatically --release flag if QT_BUILD_TESTS is set. + # Release package need to be signed. Signing is currently not supported by CI. + # What is more, also androidtestrunner is not working on release APKs, + # For example running "adb shell run-as" on release APK will finish with the error: + # run-as: Package '[PACKAGE-NAME]' is not debuggable + list(APPEND extra_args $<$,$,$>:--release>) endif() _qt_internal_check_depfile_support(has_depfile_support)