From 84cc7208dee3a8176ccbf24f7f46167c680eed7a Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Fri, 19 Jul 2024 11:59:32 +0200 Subject: [PATCH] iOS: Improve error message when installation on Simulator fails In case of error, post the output of the simctl command in compile output and issues pane. Fixes: QTCREATORBUG-25833 Change-Id: I62a0f7b10b5188a7c8b4e1db543b66d0661d4e6a Reviewed-by: Marcus Tillmanns --- src/plugins/ios/iosdeploystep.cpp | 14 ++++++++------ src/plugins/ios/simulatorcontrol.cpp | 10 +++++++--- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/src/plugins/ios/iosdeploystep.cpp b/src/plugins/ios/iosdeploystep.cpp index 596dc84d6bb..11575821330 100644 --- a/src/plugins/ios/iosdeploystep.cpp +++ b/src/plugins/ios/iosdeploystep.cpp @@ -54,12 +54,14 @@ public: int progress, int maxProgress, const QString &info) { emit progressValueChanged(progress * 100 / maxProgress, info); }); - connect(m_toolHandler.get(), &IosToolHandler::errorMsg, this, - [this](IosToolHandler *, const QString &message) { - if (message.contains(QLatin1String("AMDeviceInstallApplication returned -402653103"))) - TaskHub::addTask(DeploymentTask(Task::Warning, Tr::tr("The Info.plist might be incorrect."))); - emit errorMessage(message); - }); + connect( + m_toolHandler.get(), + &IosToolHandler::errorMsg, + this, + [this](IosToolHandler *, const QString &message) { + TaskHub::addTask(DeploymentTask(Task::Error, message)); + emit errorMessage(message); + }); connect(m_toolHandler.get(), &IosToolHandler::didTransferApp, this, [this](IosToolHandler *, const FilePath &, const QString &, IosToolHandler::OpStatus status) { diff --git a/src/plugins/ios/simulatorcontrol.cpp b/src/plugins/ios/simulatorcontrol.cpp index b702767251e..53b41d67828 100644 --- a/src/plugins/ios/simulatorcontrol.cpp +++ b/src/plugins/ios/simulatorcontrol.cpp @@ -484,10 +484,14 @@ void installApp(QPromise &promise, nullptr, &response.commandOutput, [&promise] { return promise.isCanceled(); }); - if (!result) - promise.addResult(make_unexpected(result.error())); - else + if (!result) { + const QString error = result.error().isEmpty() + ? response.commandOutput + : (result.error() + "\n" + response.commandOutput); + promise.addResult(make_unexpected(error)); + } else { promise.addResult(response); + } } void launchApp(QPromise &promise,