From acf7d30cbda7801e066636a322b748faf468b959 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Thu, 1 Feb 2024 14:47:55 +0100 Subject: [PATCH] iOS 17: Print messages for starting and stopping MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In the application output, like we do when running elsewhere. Change-Id: I842701162df20403e2b9757bc78bdd61176d581d Reviewed-by: Qt CI Bot Reviewed-by: Reviewed-by: Tor Arne Vestbø --- src/plugins/ios/iosrunner.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/plugins/ios/iosrunner.cpp b/src/plugins/ios/iosrunner.cpp index 57922d03564..65377954319 100644 --- a/src/plugins/ios/iosrunner.cpp +++ b/src/plugins/ios/iosrunner.cpp @@ -99,6 +99,7 @@ private: GroupItem findProcess(Storage &appInfo); GroupItem killProcess(Storage &appInfo); GroupItem launchTask(const QString &bundleIdentifier); + void reportStoppedImpl(); FilePath m_bundlePath; QStringList m_arguments; @@ -261,6 +262,13 @@ GroupItem DeviceCtlRunner::launchTask(const QString &bundleIdentifier) return ProcessTask(onSetup, onDone); } +void DeviceCtlRunner::reportStoppedImpl() +{ + appendMessage(Tr::tr("\"%1\" exited").arg(m_bundlePath.toUserOutput()), + Utils::NormalMessageFormat); + reportStopped(); +} + void DeviceCtlRunner::start() { QSettings settings(m_bundlePath.pathAppended("Info.plist").toString(), QSettings::NativeFormat); @@ -271,6 +279,10 @@ void DeviceCtlRunner::start() return; } + appendMessage(Tr::tr("Running \"%1\" on %2...") + .arg(m_bundlePath.toUserOutput(), device()->displayName()), + NormalMessageFormat); + // If the app is already running, we should first kill it, then launch again. // Usually deployment already kills the running app, but we support running without // deployment. Restarting is then e.g. needed if the app arguments changed. @@ -298,7 +310,7 @@ void DeviceCtlRunner::stop() m_pollTask.release()->deleteLater(); const auto onSetup = [this](Process &process) { if (!m_device) { - reportStopped(); + reportStoppedImpl(); return SetupResult::StopWithError; } process.setCommand({FilePath::fromString("/usr/bin/xcrun"), @@ -328,7 +340,7 @@ void DeviceCtlRunner::stop() reportFailure(resultValue.error()); return DoneResult::Error; } - reportStopped(); + reportStoppedImpl(); return DoneResult::Success; }; m_runTask.reset(new TaskTree(Group{ProcessTask(onSetup, onDone)})); @@ -364,7 +376,7 @@ void DeviceCtlRunner::checkProcess() // no process with processIdentifier found, or some error occurred, device disconnected // or such, assume "stopped" m_pollTimer.stop(); - reportStopped(); + reportStoppedImpl(); } m_pollTask.release()->deleteLater(); return DoneResult::Success;