Commit aa355b4f authored by Vikas Pachdha's avatar Vikas Pachdha Committed by Eike Ziller

iOS: Make iOS simulator usage asynchronous

Change-Id: I5770b372542690560680ef3208a284c7f0cf6670
Reviewed-by: Eike Ziller's avatarEike Ziller <>
parent c49a0dd5
This diff is collapsed.
This diff is collapsed.
......@@ -22,10 +22,10 @@
** be met:
#pragma once
#include <QHash>
#include <QObject>
#include <QFuture>
#include "utils/fileutils.h"
......@@ -38,29 +38,44 @@ namespace Internal {
class IosDeviceType;
class SimulatorControlPrivate;
class SimulatorControl
class SimulatorControl : public QObject
explicit SimulatorControl();
struct ResponseData {
ResponseData(const QString & udid):
simUdid(udid) { }
QString simUdid;
bool success = false;
qint64 pID = -1;
QByteArray commandOutput = "";
// For response type APP_SPAWN, the processInstance represents the control process of the spwaned app
// For other response types its null.
std::shared_ptr<QProcess> processInstance;
explicit SimulatorControl(QObject* parent = nullptr);
static QList<IosDeviceType> availableSimulators();
static void updateAvailableSimulators();
static bool startSimulator(const QString &simUdid);
static bool isSimulatorRunning(const QString &simUdid);
static bool installApp(const QString &simUdid, const Utils::FileName &bundlePath, QByteArray &commandOutput);
static QProcess* spawnAppProcess(const QString &simUdid, const Utils::FileName &bundlePath, qint64 &pId,
bool waitForDebugger, const QStringList &extraArgs);
static qint64 launchApp(const QString &simUdid, const QString &bundleIdentifier, QByteArray *commandOutput = nullptr);
static QString bundleIdentifier(const Utils::FileName &bundlePath);
static QString bundleExecutable(const Utils::FileName &bundlePath);
static bool waitForProcessSpawn(qint64 processPId);
QFuture<ResponseData> startSimulator(const QString &simUdid);
QFuture<ResponseData> installApp(const QString &simUdid, const Utils::FileName &bundlePath) const;
QFuture<ResponseData> spawnAppProcess(const QString &simUdid, const Utils::FileName &bundlePath,
bool waitForDebugger, const QStringList &extraArgs) const;
QFuture<ResponseData> launchApp(const QString &simUdid, const QString &bundleIdentifier,
qint64 spawnedPID = -1) const;
static SimulatorControlPrivate *d;
SimulatorControlPrivate *d;
} // namespace Internal
} // namespace Ios
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment