From 1f69f4e5c959d8aad1b018a0fbe2f95a8eb46868 Mon Sep 17 00:00:00 2001 From: Assam Boudjelthia Date: Mon, 2 Dec 2024 15:03:24 +0200 Subject: [PATCH] Android: add option to run app detached to runner script Allow the script to install, deploy and start the app without waiting for the logs. Change-Id: Id852d827f627b902a75d1ed8101892552bd4202d Reviewed-by: Ville Voutilainen (cherry picked from commit df3f5d88d389ef204bf9e0f86238300b23803616) Reviewed-by: Qt Cherry-pick Bot --- libexec/qt-android-runner.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libexec/qt-android-runner.py b/libexec/qt-android-runner.py index 6c667052508..20ae3b0d098 100644 --- a/libexec/qt-android-runner.py +++ b/libexec/qt-android-runner.py @@ -41,11 +41,12 @@ parser.add_argument('-a', '--adb', metavar='path', type=str, help='Path to adb e parser.add_argument('-b', '--build-path', metavar='path', type=str, help='Path to the Android build directory.') parser.add_argument('-i', '--install', action='store_true', help='Install the APK.') +parser.add_argument('-d', '--detached', action='store_true', + help='Start the app detached without waiting for the logcat') parser.add_argument('-s', '--serial', type=str, metavar='serial', help='Android device serial (override $ANDROID_SERIAL).') parser.add_argument('-p', '--apk', type=str, metavar='path', help='Path to the APK file.') - args, remaining_args = parser.parse_known_args() # Validate required arguments @@ -159,6 +160,9 @@ while pid is None: except subprocess.CalledProcessError: continue +if args.detached: + sys.exit(0) + # Add a signal handler to stop the app if the script is terminated interrupted = False def terminate_app(signum, frame):