forked from qt-creator/qt-creator
iOS: Proliferate FilePath a bit
Unlikely to make a difference in practice, but removes so unwanted .toString/.exists. Change-Id: I32c037aa87bb13cecb5b783fe0b36850e163f9c5 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -46,11 +46,11 @@ private:
|
|||||||
void doRun() final;
|
void doRun() final;
|
||||||
void doCancel() final;
|
void doCancel() final;
|
||||||
|
|
||||||
void handleIsTransferringApp(IosToolHandler *handler, const QString &bundlePath,
|
void handleIsTransferringApp(IosToolHandler *handler, const FilePath &bundlePath,
|
||||||
const QString &deviceId, int progress, int maxProgress,
|
const QString &deviceId, int progress, int maxProgress,
|
||||||
const QString &info);
|
const QString &info);
|
||||||
void handleDidTransferApp(IosToolHandler *handler, const QString &bundlePath, const QString &deviceId,
|
void handleDidTransferApp(IosToolHandler *handler, const FilePath &bundlePath,
|
||||||
IosToolHandler::OpStatus status);
|
const QString &deviceId, IosToolHandler::OpStatus status);
|
||||||
void handleFinished(IosToolHandler *handler);
|
void handleFinished(IosToolHandler *handler);
|
||||||
void handleErrorMsg(IosToolHandler *handler, const QString &msg);
|
void handleErrorMsg(IosToolHandler *handler, const QString &msg);
|
||||||
void updateDisplayNames();
|
void updateDisplayNames();
|
||||||
@@ -133,7 +133,7 @@ void IosDeployStep::doRun()
|
|||||||
connect(m_toolHandler, &IosToolHandler::errorMsg,
|
connect(m_toolHandler, &IosToolHandler::errorMsg,
|
||||||
this, &IosDeployStep::handleErrorMsg);
|
this, &IosDeployStep::handleErrorMsg);
|
||||||
checkProvisioningProfile();
|
checkProvisioningProfile();
|
||||||
m_toolHandler->requestTransferApp(m_bundlePath.toString(), m_deviceType.identifier);
|
m_toolHandler->requestTransferApp(m_bundlePath, m_deviceType.identifier);
|
||||||
}
|
}
|
||||||
|
|
||||||
void IosDeployStep::doCancel()
|
void IosDeployStep::doCancel()
|
||||||
@@ -151,7 +151,7 @@ void IosDeployStep::cleanup()
|
|||||||
m_expectFail = false;
|
m_expectFail = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void IosDeployStep::handleIsTransferringApp(IosToolHandler *handler, const QString &bundlePath,
|
void IosDeployStep::handleIsTransferringApp(IosToolHandler *handler, const FilePath &bundlePath,
|
||||||
const QString &deviceId, int progress, int maxProgress,
|
const QString &deviceId, int progress, int maxProgress,
|
||||||
const QString &info)
|
const QString &info)
|
||||||
{
|
{
|
||||||
@@ -160,7 +160,7 @@ void IosDeployStep::handleIsTransferringApp(IosToolHandler *handler, const QStri
|
|||||||
emit this->progress(progress * 100 / maxProgress, info);
|
emit this->progress(progress * 100 / maxProgress, info);
|
||||||
}
|
}
|
||||||
|
|
||||||
void IosDeployStep::handleDidTransferApp(IosToolHandler *handler, const QString &bundlePath,
|
void IosDeployStep::handleDidTransferApp(IosToolHandler *handler, const FilePath &bundlePath,
|
||||||
const QString &deviceId, IosToolHandler::OpStatus status)
|
const QString &deviceId, IosToolHandler::OpStatus status)
|
||||||
{
|
{
|
||||||
Q_UNUSED(handler); Q_UNUSED(bundlePath); Q_UNUSED(deviceId)
|
Q_UNUSED(handler); Q_UNUSED(bundlePath); Q_UNUSED(deviceId)
|
||||||
|
@@ -81,7 +81,7 @@ public:
|
|||||||
void setCppDebugging(bool cppDebug);
|
void setCppDebugging(bool cppDebug);
|
||||||
void setQmlDebugging(QmlDebug::QmlDebugServicesPreset qmlDebugServices);
|
void setQmlDebugging(QmlDebug::QmlDebugServicesPreset qmlDebugServices);
|
||||||
|
|
||||||
QString bundlePath();
|
Utils::FilePath bundlePath() const;
|
||||||
QString deviceId();
|
QString deviceId();
|
||||||
IosToolHandler::RunKind runType();
|
IosToolHandler::RunKind runType();
|
||||||
bool cppDebug() const;
|
bool cppDebug() const;
|
||||||
@@ -101,9 +101,9 @@ public:
|
|||||||
bool isAppRunning() const;
|
bool isAppRunning() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void handleGotServerPorts(Ios::IosToolHandler *handler, const QString &bundlePath,
|
void handleGotServerPorts(Ios::IosToolHandler *handler, const FilePath &bundlePath,
|
||||||
const QString &deviceId, Port gdbPort, Port qmlPort);
|
const QString &deviceId, Port gdbPort, Port qmlPort);
|
||||||
void handleGotInferiorPid(Ios::IosToolHandler *handler, const QString &bundlePath,
|
void handleGotInferiorPid(Ios::IosToolHandler *handler, const FilePath &bundlePath,
|
||||||
const QString &deviceId, qint64 pid);
|
const QString &deviceId, qint64 pid);
|
||||||
void handleAppOutput(Ios::IosToolHandler *handler, const QString &output);
|
void handleAppOutput(Ios::IosToolHandler *handler, const QString &output);
|
||||||
void handleErrorMsg(Ios::IosToolHandler *handler, const QString &msg);
|
void handleErrorMsg(Ios::IosToolHandler *handler, const QString &msg);
|
||||||
@@ -111,7 +111,7 @@ private:
|
|||||||
void handleFinished(Ios::IosToolHandler *handler);
|
void handleFinished(Ios::IosToolHandler *handler);
|
||||||
|
|
||||||
IosToolHandler *m_toolHandler = nullptr;
|
IosToolHandler *m_toolHandler = nullptr;
|
||||||
QString m_bundleDir;
|
FilePath m_bundleDir;
|
||||||
IDeviceConstPtr m_device;
|
IDeviceConstPtr m_device;
|
||||||
IosDeviceType m_deviceType;
|
IosDeviceType m_deviceType;
|
||||||
bool m_cppDebug = false;
|
bool m_cppDebug = false;
|
||||||
@@ -130,7 +130,7 @@ IosRunner::IosRunner(RunControl *runControl)
|
|||||||
stopRunningRunControl(runControl);
|
stopRunningRunControl(runControl);
|
||||||
const IosDeviceTypeAspect::Data *data = runControl->aspect<IosDeviceTypeAspect>();
|
const IosDeviceTypeAspect::Data *data = runControl->aspect<IosDeviceTypeAspect>();
|
||||||
QTC_ASSERT(data, return);
|
QTC_ASSERT(data, return);
|
||||||
m_bundleDir = data->bundleDirectory.toString();
|
m_bundleDir = data->bundleDirectory;
|
||||||
m_device = DeviceKitAspect::device(runControl->kit());
|
m_device = DeviceKitAspect::device(runControl->kit());
|
||||||
m_deviceType = data->deviceType;
|
m_deviceType = data->deviceType;
|
||||||
}
|
}
|
||||||
@@ -150,7 +150,7 @@ void IosRunner::setQmlDebugging(QmlDebug::QmlDebugServicesPreset qmlDebugService
|
|||||||
m_qmlDebugServices = qmlDebugServices;
|
m_qmlDebugServices = qmlDebugServices;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString IosRunner::bundlePath()
|
FilePath IosRunner::bundlePath() const
|
||||||
{
|
{
|
||||||
return m_bundleDir;
|
return m_bundleDir;
|
||||||
}
|
}
|
||||||
@@ -192,9 +192,9 @@ void IosRunner::start()
|
|||||||
|
|
||||||
m_cleanExit = false;
|
m_cleanExit = false;
|
||||||
m_qmlServerPort = Port();
|
m_qmlServerPort = Port();
|
||||||
if (!QFileInfo::exists(m_bundleDir)) {
|
if (!m_bundleDir.exists()) {
|
||||||
TaskHub::addTask(DeploymentTask(Task::Warning,
|
TaskHub::addTask(DeploymentTask(Task::Warning,
|
||||||
Tr::tr("Could not find %1.").arg(m_bundleDir)));
|
Tr::tr("Could not find %1.").arg(m_bundleDir.toUserOutput())));
|
||||||
reportFailure();
|
reportFailure();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -247,7 +247,7 @@ void IosRunner::stop()
|
|||||||
m_toolHandler->stop();
|
m_toolHandler->stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
void IosRunner::handleGotServerPorts(IosToolHandler *handler, const QString &bundlePath,
|
void IosRunner::handleGotServerPorts(IosToolHandler *handler, const FilePath &bundlePath,
|
||||||
const QString &deviceId, Port gdbPort,
|
const QString &deviceId, Port gdbPort,
|
||||||
Port qmlPort)
|
Port qmlPort)
|
||||||
{
|
{
|
||||||
@@ -278,7 +278,7 @@ void IosRunner::handleGotServerPorts(IosToolHandler *handler, const QString &bun
|
|||||||
reportFailure(Tr::tr("Could not get necessary ports for the debugger connection."));
|
reportFailure(Tr::tr("Could not get necessary ports for the debugger connection."));
|
||||||
}
|
}
|
||||||
|
|
||||||
void IosRunner::handleGotInferiorPid(IosToolHandler *handler, const QString &bundlePath,
|
void IosRunner::handleGotInferiorPid(IosToolHandler *handler, const FilePath &bundlePath,
|
||||||
const QString &deviceId, qint64 pid)
|
const QString &deviceId, qint64 pid)
|
||||||
{
|
{
|
||||||
// Called when debugging on Simulator.
|
// Called when debugging on Simulator.
|
||||||
|
@@ -20,7 +20,6 @@
|
|||||||
#include <utils/temporarydirectory.h>
|
#include <utils/temporarydirectory.h>
|
||||||
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QFileInfo>
|
|
||||||
#include <QFutureWatcher>
|
#include <QFutureWatcher>
|
||||||
#include <QJsonArray>
|
#include <QJsonArray>
|
||||||
#include <QJsonDocument>
|
#include <QJsonDocument>
|
||||||
@@ -42,6 +41,8 @@
|
|||||||
|
|
||||||
static Q_LOGGING_CATEGORY(toolHandlerLog, "qtc.ios.toolhandler", QtWarningMsg)
|
static Q_LOGGING_CATEGORY(toolHandlerLog, "qtc.ios.toolhandler", QtWarningMsg)
|
||||||
|
|
||||||
|
using namespace Utils;
|
||||||
|
|
||||||
namespace Ios {
|
namespace Ios {
|
||||||
|
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
@@ -166,9 +167,9 @@ class IosToolHandlerPrivate
|
|||||||
public:
|
public:
|
||||||
explicit IosToolHandlerPrivate(const IosDeviceType &devType, IosToolHandler *q);
|
explicit IosToolHandlerPrivate(const IosDeviceType &devType, IosToolHandler *q);
|
||||||
virtual ~IosToolHandlerPrivate();
|
virtual ~IosToolHandlerPrivate();
|
||||||
virtual void requestTransferApp(const QString &bundlePath, const QString &deviceId,
|
virtual void requestTransferApp(const FilePath &bundlePath, const QString &deviceId,
|
||||||
int timeout = 1000) = 0;
|
int timeout = 1000) = 0;
|
||||||
virtual void requestRunApp(const QString &bundlePath, const QStringList &extraArgs,
|
virtual void requestRunApp(const FilePath &bundlePath, const QStringList &extraArgs,
|
||||||
IosToolHandler::RunKind runKind,
|
IosToolHandler::RunKind runKind,
|
||||||
const QString &deviceId, int timeout = 1000) = 0;
|
const QString &deviceId, int timeout = 1000) = 0;
|
||||||
virtual void requestDeviceInfo(const QString &deviceId, int timeout = 1000) = 0;
|
virtual void requestDeviceInfo(const QString &deviceId, int timeout = 1000) = 0;
|
||||||
@@ -176,15 +177,15 @@ public:
|
|||||||
virtual void stop(int errorCode) = 0;
|
virtual void stop(int errorCode) = 0;
|
||||||
|
|
||||||
// signals
|
// signals
|
||||||
void isTransferringApp(const QString &bundlePath, const QString &deviceId, int progress,
|
void isTransferringApp(const FilePath &bundlePath, const QString &deviceId, int progress,
|
||||||
int maxProgress, const QString &info);
|
int maxProgress, const QString &info);
|
||||||
void didTransferApp(const QString &bundlePath, const QString &deviceId,
|
void didTransferApp(const FilePath &bundlePath, const QString &deviceId,
|
||||||
IosToolHandler::OpStatus status);
|
IosToolHandler::OpStatus status);
|
||||||
void didStartApp(const QString &bundlePath, const QString &deviceId,
|
void didStartApp(const FilePath &bundlePath, const QString &deviceId,
|
||||||
IosToolHandler::OpStatus status);
|
IosToolHandler::OpStatus status);
|
||||||
void gotServerPorts(const QString &bundlePath, const QString &deviceId, Utils::Port gdbPort,
|
void gotServerPorts(const FilePath &bundlePath, const QString &deviceId, Port gdbPort,
|
||||||
Utils::Port qmlPort);
|
Port qmlPort);
|
||||||
void gotInferiorPid(const QString &bundlePath, const QString &deviceId, qint64 pid);
|
void gotInferiorPid(const FilePath &bundlePath, const QString &deviceId, qint64 pid);
|
||||||
void deviceInfo(const QString &deviceId, const IosToolHandler::Dict &info);
|
void deviceInfo(const QString &deviceId, const IosToolHandler::Dict &info);
|
||||||
void appOutput(const QString &output);
|
void appOutput(const QString &output);
|
||||||
void errorMsg(const QString &msg);
|
void errorMsg(const QString &msg);
|
||||||
@@ -193,7 +194,7 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
IosToolHandler *q;
|
IosToolHandler *q;
|
||||||
QString m_deviceId;
|
QString m_deviceId;
|
||||||
QString m_bundlePath;
|
FilePath m_bundlePath;
|
||||||
IosToolHandler::RunKind m_runKind = IosToolHandler::NormalRun;
|
IosToolHandler::RunKind m_runKind = IosToolHandler::NormalRun;
|
||||||
IosDeviceType m_devType;
|
IosDeviceType m_devType;
|
||||||
};
|
};
|
||||||
@@ -219,9 +220,9 @@ public:
|
|||||||
|
|
||||||
// IosToolHandlerPrivate overrides
|
// IosToolHandlerPrivate overrides
|
||||||
public:
|
public:
|
||||||
void requestTransferApp(const QString &bundlePath, const QString &deviceId,
|
void requestTransferApp(const FilePath &bundlePath, const QString &deviceId,
|
||||||
int timeout = 1000) override;
|
int timeout = 1000) override;
|
||||||
void requestRunApp(const QString &bundlePath, const QStringList &extraArgs,
|
void requestRunApp(const FilePath &bundlePath, const QStringList &extraArgs,
|
||||||
IosToolHandler::RunKind runKind,
|
IosToolHandler::RunKind runKind,
|
||||||
const QString &deviceId, int timeout = 1000) override;
|
const QString &deviceId, int timeout = 1000) override;
|
||||||
void requestDeviceInfo(const QString &deviceId, int timeout = 1000) override;
|
void requestDeviceInfo(const QString &deviceId, int timeout = 1000) override;
|
||||||
@@ -287,9 +288,9 @@ public:
|
|||||||
|
|
||||||
// IosToolHandlerPrivate overrides
|
// IosToolHandlerPrivate overrides
|
||||||
public:
|
public:
|
||||||
void requestTransferApp(const QString &appBundlePath, const QString &deviceIdentifier,
|
void requestTransferApp(const FilePath &appBundlePath, const QString &deviceIdentifier,
|
||||||
int timeout = 1000) override;
|
int timeout = 1000) override;
|
||||||
void requestRunApp(const QString &appBundlePath, const QStringList &extraArgs,
|
void requestRunApp(const FilePath &appBundlePath, const QStringList &extraArgs,
|
||||||
IosToolHandler::RunKind runKind,
|
IosToolHandler::RunKind runKind,
|
||||||
const QString &deviceIdentifier, int timeout = 1000) override;
|
const QString &deviceIdentifier, int timeout = 1000) override;
|
||||||
void requestDeviceInfo(const QString &deviceId, int timeout = 1000) override;
|
void requestDeviceInfo(const QString &deviceId, int timeout = 1000) override;
|
||||||
@@ -317,31 +318,31 @@ IosToolHandlerPrivate::IosToolHandlerPrivate(const IosDeviceType &devType,
|
|||||||
IosToolHandlerPrivate::~IosToolHandlerPrivate() = default;
|
IosToolHandlerPrivate::~IosToolHandlerPrivate() = default;
|
||||||
|
|
||||||
// signals
|
// signals
|
||||||
void IosToolHandlerPrivate::isTransferringApp(const QString &bundlePath, const QString &deviceId,
|
void IosToolHandlerPrivate::isTransferringApp(const FilePath &bundlePath, const QString &deviceId,
|
||||||
int progress, int maxProgress, const QString &info)
|
int progress, int maxProgress, const QString &info)
|
||||||
{
|
{
|
||||||
emit q->isTransferringApp(q, bundlePath, deviceId, progress, maxProgress, info);
|
emit q->isTransferringApp(q, bundlePath, deviceId, progress, maxProgress, info);
|
||||||
}
|
}
|
||||||
|
|
||||||
void IosToolHandlerPrivate::didTransferApp(const QString &bundlePath, const QString &deviceId,
|
void IosToolHandlerPrivate::didTransferApp(const FilePath &bundlePath, const QString &deviceId,
|
||||||
Ios::IosToolHandler::OpStatus status)
|
Ios::IosToolHandler::OpStatus status)
|
||||||
{
|
{
|
||||||
emit q->didTransferApp(q, bundlePath, deviceId, status);
|
emit q->didTransferApp(q, bundlePath, deviceId, status);
|
||||||
}
|
}
|
||||||
|
|
||||||
void IosToolHandlerPrivate::didStartApp(const QString &bundlePath, const QString &deviceId,
|
void IosToolHandlerPrivate::didStartApp(const FilePath &bundlePath, const QString &deviceId,
|
||||||
IosToolHandler::OpStatus status)
|
IosToolHandler::OpStatus status)
|
||||||
{
|
{
|
||||||
emit q->didStartApp(q, bundlePath, deviceId, status);
|
emit q->didStartApp(q, bundlePath, deviceId, status);
|
||||||
}
|
}
|
||||||
|
|
||||||
void IosToolHandlerPrivate::gotServerPorts(const QString &bundlePath, const QString &deviceId,
|
void IosToolHandlerPrivate::gotServerPorts(const FilePath &bundlePath, const QString &deviceId,
|
||||||
Utils::Port gdbPort, Utils::Port qmlPort)
|
Port gdbPort, Port qmlPort)
|
||||||
{
|
{
|
||||||
emit q->gotServerPorts(q, bundlePath, deviceId, gdbPort, qmlPort);
|
emit q->gotServerPorts(q, bundlePath, deviceId, gdbPort, qmlPort);
|
||||||
}
|
}
|
||||||
|
|
||||||
void IosToolHandlerPrivate::gotInferiorPid(const QString &bundlePath, const QString &deviceId,
|
void IosToolHandlerPrivate::gotInferiorPid(const FilePath &bundlePath, const QString &deviceId,
|
||||||
qint64 pid)
|
qint64 pid)
|
||||||
{
|
{
|
||||||
emit q->gotInferiorPid(q, bundlePath, deviceId, pid);
|
emit q->gotInferiorPid(q, bundlePath, deviceId, pid);
|
||||||
@@ -674,7 +675,7 @@ IosDeviceToolHandlerPrivate::~IosDeviceToolHandlerPrivate()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void IosDeviceToolHandlerPrivate::requestTransferApp(const QString &bundlePath,
|
void IosDeviceToolHandlerPrivate::requestTransferApp(const FilePath &bundlePath,
|
||||||
const QString &deviceId, int timeout)
|
const QString &deviceId, int timeout)
|
||||||
{
|
{
|
||||||
m_bundlePath = bundlePath;
|
m_bundlePath = bundlePath;
|
||||||
@@ -682,7 +683,7 @@ void IosDeviceToolHandlerPrivate::requestTransferApp(const QString &bundlePath,
|
|||||||
QString tmpDeltaPath = Utils::TemporaryDirectory::masterDirectoryFilePath().pathAppended("ios").toString();
|
QString tmpDeltaPath = Utils::TemporaryDirectory::masterDirectoryFilePath().pathAppended("ios").toString();
|
||||||
QStringList args;
|
QStringList args;
|
||||||
args << QLatin1String("--id") << deviceId << QLatin1String("--bundle")
|
args << QLatin1String("--id") << deviceId << QLatin1String("--bundle")
|
||||||
<< bundlePath << QLatin1String("--timeout") << QString::number(timeout)
|
<< bundlePath.path() << QLatin1String("--timeout") << QString::number(timeout)
|
||||||
<< QLatin1String("--install")
|
<< QLatin1String("--install")
|
||||||
<< QLatin1String("--delta-path")
|
<< QLatin1String("--delta-path")
|
||||||
<< tmpDeltaPath;
|
<< tmpDeltaPath;
|
||||||
@@ -690,7 +691,7 @@ void IosDeviceToolHandlerPrivate::requestTransferApp(const QString &bundlePath,
|
|||||||
start(IosToolHandler::iosDeviceToolPath(), args);
|
start(IosToolHandler::iosDeviceToolPath(), args);
|
||||||
}
|
}
|
||||||
|
|
||||||
void IosDeviceToolHandlerPrivate::requestRunApp(const QString &bundlePath,
|
void IosDeviceToolHandlerPrivate::requestRunApp(const FilePath &bundlePath,
|
||||||
const QStringList &extraArgs,
|
const QStringList &extraArgs,
|
||||||
IosToolHandler::RunKind runType,
|
IosToolHandler::RunKind runType,
|
||||||
const QString &deviceId, int timeout)
|
const QString &deviceId, int timeout)
|
||||||
@@ -700,7 +701,7 @@ void IosDeviceToolHandlerPrivate::requestRunApp(const QString &bundlePath,
|
|||||||
m_runKind = runType;
|
m_runKind = runType;
|
||||||
QStringList args;
|
QStringList args;
|
||||||
args << QLatin1String("--id") << deviceId << QLatin1String("--bundle")
|
args << QLatin1String("--id") << deviceId << QLatin1String("--bundle")
|
||||||
<< bundlePath << QLatin1String("--timeout") << QString::number(timeout);
|
<< bundlePath.path() << QLatin1String("--timeout") << QString::number(timeout);
|
||||||
switch (runType) {
|
switch (runType) {
|
||||||
case IosToolHandler::NormalRun:
|
case IosToolHandler::NormalRun:
|
||||||
args << QLatin1String("--run");
|
args << QLatin1String("--run");
|
||||||
@@ -789,7 +790,7 @@ IosSimulatorToolHandlerPrivate::IosSimulatorToolHandlerPrivate(const IosDeviceTy
|
|||||||
std::bind(&IosToolHandlerPrivate::appOutput, this, _1));
|
std::bind(&IosToolHandlerPrivate::appOutput, this, _1));
|
||||||
}
|
}
|
||||||
|
|
||||||
void IosSimulatorToolHandlerPrivate::requestTransferApp(const QString &appBundlePath,
|
void IosSimulatorToolHandlerPrivate::requestTransferApp(const FilePath &appBundlePath,
|
||||||
const QString &deviceIdentifier, int timeout)
|
const QString &deviceIdentifier, int timeout)
|
||||||
{
|
{
|
||||||
Q_UNUSED(timeout)
|
Q_UNUSED(timeout)
|
||||||
@@ -817,7 +818,7 @@ void IosSimulatorToolHandlerPrivate::requestTransferApp(const QString &appBundle
|
|||||||
SimulatorControl::startSimulator(m_deviceId), q, onSimulatorStart));
|
SimulatorControl::startSimulator(m_deviceId), q, onSimulatorStart));
|
||||||
}
|
}
|
||||||
|
|
||||||
void IosSimulatorToolHandlerPrivate::requestRunApp(const QString &appBundlePath,
|
void IosSimulatorToolHandlerPrivate::requestRunApp(const FilePath &appBundlePath,
|
||||||
const QStringList &extraArgs,
|
const QStringList &extraArgs,
|
||||||
IosToolHandler::RunKind runType,
|
IosToolHandler::RunKind runType,
|
||||||
const QString &deviceIdentifier, int timeout)
|
const QString &deviceIdentifier, int timeout)
|
||||||
@@ -828,10 +829,9 @@ void IosSimulatorToolHandlerPrivate::requestRunApp(const QString &appBundlePath,
|
|||||||
m_deviceId = m_devType.identifier;
|
m_deviceId = m_devType.identifier;
|
||||||
m_runKind = runType;
|
m_runKind = runType;
|
||||||
|
|
||||||
Utils::FilePath appBundle = Utils::FilePath::fromString(m_bundlePath);
|
if (!m_bundlePath.exists()) {
|
||||||
if (!appBundle.exists()) {
|
|
||||||
errorMsg(Tr::tr("Application launch on simulator failed. Invalid bundle path %1")
|
errorMsg(Tr::tr("Application launch on simulator failed. Invalid bundle path %1")
|
||||||
.arg(m_bundlePath));
|
.arg(m_bundlePath.toUserOutput()));
|
||||||
didStartApp(m_bundlePath, m_deviceId, Ios::IosToolHandler::Failure);
|
didStartApp(m_bundlePath, m_deviceId, Ios::IosToolHandler::Failure);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -901,15 +901,13 @@ void IosSimulatorToolHandlerPrivate::installAppOnSimulator()
|
|||||||
};
|
};
|
||||||
|
|
||||||
isTransferringApp(m_bundlePath, m_deviceId, 20, 100, "");
|
isTransferringApp(m_bundlePath, m_deviceId, 20, 100, "");
|
||||||
auto installFuture = SimulatorControl::installApp(m_deviceId,
|
auto installFuture = SimulatorControl::installApp(m_deviceId, m_bundlePath);
|
||||||
Utils::FilePath::fromString(m_bundlePath));
|
|
||||||
futureSynchronizer.addFuture(Utils::onResultReady(installFuture, q, onResponseAppInstall));
|
futureSynchronizer.addFuture(Utils::onResultReady(installFuture, q, onResponseAppInstall));
|
||||||
}
|
}
|
||||||
|
|
||||||
void IosSimulatorToolHandlerPrivate::launchAppOnSimulator(const QStringList &extraArgs)
|
void IosSimulatorToolHandlerPrivate::launchAppOnSimulator(const QStringList &extraArgs)
|
||||||
{
|
{
|
||||||
const Utils::FilePath appBundle = Utils::FilePath::fromString(m_bundlePath);
|
const QString bundleId = SimulatorControl::bundleIdentifier(m_bundlePath);
|
||||||
const QString bundleId = SimulatorControl::bundleIdentifier(appBundle);
|
|
||||||
const bool debugRun = m_runKind == IosToolHandler::DebugRun;
|
const bool debugRun = m_runKind == IosToolHandler::DebugRun;
|
||||||
bool captureConsole = IosConfigurations::xcodeVersion() >= QVersionNumber(8);
|
bool captureConsole = IosConfigurations::xcodeVersion() >= QVersionNumber(8);
|
||||||
std::shared_ptr<QTemporaryFile> stdoutFile;
|
std::shared_ptr<QTemporaryFile> stdoutFile;
|
||||||
@@ -1012,13 +1010,13 @@ void IosToolHandler::stop()
|
|||||||
d->stop(-1);
|
d->stop(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void IosToolHandler::requestTransferApp(const QString &bundlePath, const QString &deviceId,
|
void IosToolHandler::requestTransferApp(const FilePath &bundlePath, const QString &deviceId,
|
||||||
int timeout)
|
int timeout)
|
||||||
{
|
{
|
||||||
d->requestTransferApp(bundlePath, deviceId, timeout);
|
d->requestTransferApp(bundlePath, deviceId, timeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
void IosToolHandler::requestRunApp(const QString &bundlePath, const QStringList &extraArgs,
|
void IosToolHandler::requestRunApp(const FilePath &bundlePath, const QStringList &extraArgs,
|
||||||
RunKind runType, const QString &deviceId, int timeout)
|
RunKind runType, const QString &deviceId, int timeout)
|
||||||
{
|
{
|
||||||
d->requestRunApp(bundlePath, extraArgs, runType, deviceId, timeout);
|
d->requestRunApp(bundlePath, extraArgs, runType, deviceId, timeout);
|
||||||
|
@@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <utils/filepath.h>
|
||||||
#include <utils/port.h>
|
#include <utils/port.h>
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
@@ -35,24 +36,24 @@ public:
|
|||||||
|
|
||||||
explicit IosToolHandler(const Internal::IosDeviceType &type, QObject *parent = nullptr);
|
explicit IosToolHandler(const Internal::IosDeviceType &type, QObject *parent = nullptr);
|
||||||
~IosToolHandler() override;
|
~IosToolHandler() override;
|
||||||
void requestTransferApp(const QString &bundlePath, const QString &deviceId, int timeout = 1000);
|
void requestTransferApp(const Utils::FilePath &bundlePath, const QString &deviceId, int timeout = 1000);
|
||||||
void requestRunApp(const QString &bundlePath, const QStringList &extraArgs, RunKind runType,
|
void requestRunApp(const Utils::FilePath &bundlePath, const QStringList &extraArgs, RunKind runType,
|
||||||
const QString &deviceId, int timeout = 1000);
|
const QString &deviceId, int timeout = 1000);
|
||||||
void requestDeviceInfo(const QString &deviceId, int timeout = 1000);
|
void requestDeviceInfo(const QString &deviceId, int timeout = 1000);
|
||||||
bool isRunning() const;
|
bool isRunning() const;
|
||||||
void stop();
|
void stop();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void isTransferringApp(Ios::IosToolHandler *handler, const QString &bundlePath,
|
void isTransferringApp(Ios::IosToolHandler *handler, const Utils::FilePath &bundlePath,
|
||||||
const QString &deviceId, int progress, int maxProgress,
|
const QString &deviceId, int progress, int maxProgress,
|
||||||
const QString &info);
|
const QString &info);
|
||||||
void didTransferApp(Ios::IosToolHandler *handler, const QString &bundlePath,
|
void didTransferApp(Ios::IosToolHandler *handler, const Utils::FilePath &bundlePath,
|
||||||
const QString &deviceId, Ios::IosToolHandler::OpStatus status);
|
const QString &deviceId, Ios::IosToolHandler::OpStatus status);
|
||||||
void didStartApp(Ios::IosToolHandler *handler, const QString &bundlePath,
|
void didStartApp(Ios::IosToolHandler *handler, const Utils::FilePath &bundlePath,
|
||||||
const QString &deviceId, Ios::IosToolHandler::OpStatus status);
|
const QString &deviceId, Ios::IosToolHandler::OpStatus status);
|
||||||
void gotServerPorts(Ios::IosToolHandler *handler, const QString &bundlePath,
|
void gotServerPorts(Ios::IosToolHandler *handler, const Utils::FilePath &bundlePath,
|
||||||
const QString &deviceId, Utils::Port gdbPort, Utils::Port qmlPort);
|
const QString &deviceId, Utils::Port gdbPort, Utils::Port qmlPort);
|
||||||
void gotInferiorPid(Ios::IosToolHandler *handler, const QString &bundlePath,
|
void gotInferiorPid(Ios::IosToolHandler *handler, const Utils::FilePath &bundlePath,
|
||||||
const QString &deviceId, qint64 pid);
|
const QString &deviceId, qint64 pid);
|
||||||
void deviceInfo(Ios::IosToolHandler *handler, const QString &deviceId,
|
void deviceInfo(Ios::IosToolHandler *handler, const QString &deviceId,
|
||||||
const Ios::IosToolHandler::Dict &info);
|
const Ios::IosToolHandler::Dict &info);
|
||||||
|
Reference in New Issue
Block a user