diff --git a/src/plugins/ios/iostoolhandler.cpp b/src/plugins/ios/iostoolhandler.cpp index b1c1773cfc1..64c362de47f 100644 --- a/src/plugins/ios/iostoolhandler.cpp +++ b/src/plugins/ios/iostoolhandler.cpp @@ -54,6 +54,7 @@ #include #include +#include #include #include @@ -930,16 +931,13 @@ void IosSimulatorToolHandlerPrivate::launchAppOnSimulator(const QStringList &ext "Install Xcode 8 or later.").arg(bundleId)); } - auto monitorPid = [this](QFutureInterface &fi, qint64 pid) { - int exitCode = 0; - const QStringList args({QStringLiteral("-0"), QString::number(pid)}); - Utils::SynchronousProcess pKill; - while (!fi.isCanceled() && exitCode == 0) { + auto monitorPid = [this](QFutureInterface &fi, qint64 pid) { +#ifdef Q_OS_UNIX + do { // Poll every 1 sec to check whether the app is running. QThread::msleep(1000); - Utils::SynchronousProcessResponse resp = pKill.runBlocking(QStringLiteral("kill"), args); - exitCode = resp.exitCode; - } + } while (!fi.isCanceled() && kill(pid, 0) == 0); +#endif // Future is cancelled if the app is stopped from the qt creator. if (!fi.isCanceled()) stop(0);