2013-04-25 16:02:17 +02:00
|
|
|
/****************************************************************************
|
|
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** Copyright (C) 2016 The Qt Company Ltd.
|
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
2013-04-25 16:02:17 +02:00
|
|
|
**
|
|
|
|
|
** This file is part of Qt Creator.
|
|
|
|
|
**
|
|
|
|
|
** Commercial License Usage
|
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
2016-01-15 14:57:40 +01:00
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
2013-04-25 16:02:17 +02:00
|
|
|
**
|
2016-01-15 14:57:40 +01:00
|
|
|
** GNU General Public License Usage
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
2013-04-25 16:02:17 +02:00
|
|
|
**
|
|
|
|
|
****************************************************************************/
|
2016-01-15 14:57:40 +01:00
|
|
|
|
2016-03-18 07:55:01 +01:00
|
|
|
#pragma once
|
2013-04-25 16:02:17 +02:00
|
|
|
|
|
|
|
|
#include "iosconfigurations.h"
|
2014-03-28 19:05:35 +01:00
|
|
|
#include "iostoolhandler.h"
|
2014-11-12 19:41:59 +01:00
|
|
|
#include "iossimulator.h"
|
2014-03-28 19:05:35 +01:00
|
|
|
|
|
|
|
|
#include <projectexplorer/devicesupport/idevice.h>
|
2015-08-10 17:43:58 +02:00
|
|
|
#include <qmldebug/qmldebugcommandlinearguments.h>
|
2013-04-25 16:02:17 +02:00
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
|
#include <QTimer>
|
|
|
|
|
#include <QThread>
|
|
|
|
|
#include <QProcess>
|
|
|
|
|
#include <QMutex>
|
|
|
|
|
|
|
|
|
|
namespace Ios {
|
|
|
|
|
namespace Internal {
|
|
|
|
|
|
|
|
|
|
class IosRunConfiguration;
|
|
|
|
|
|
|
|
|
|
class IosRunner : public QObject
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
2015-08-10 17:43:58 +02:00
|
|
|
IosRunner(QObject *parent, IosRunConfiguration *runConfig, bool cppDebug,
|
|
|
|
|
QmlDebug::QmlDebugServicesPreset qmlDebugServices);
|
2013-04-25 16:02:17 +02:00
|
|
|
~IosRunner();
|
|
|
|
|
|
|
|
|
|
QString displayName() const;
|
|
|
|
|
|
|
|
|
|
QString bundlePath();
|
|
|
|
|
QStringList extraArgs();
|
|
|
|
|
QString deviceId();
|
|
|
|
|
IosToolHandler::RunKind runType();
|
2014-02-25 22:48:19 +01:00
|
|
|
bool cppDebug() const;
|
2015-08-10 17:43:58 +02:00
|
|
|
QmlDebug::QmlDebugServicesPreset qmlDebugServices() const;
|
2013-04-25 16:02:17 +02:00
|
|
|
public slots:
|
|
|
|
|
void start();
|
|
|
|
|
void stop();
|
|
|
|
|
|
|
|
|
|
signals:
|
|
|
|
|
void didStartApp(Ios::IosToolHandler::OpStatus status);
|
2016-04-19 16:43:30 +02:00
|
|
|
void gotServerPorts(Utils::Port gdbPort, Utils::Port qmlPort);
|
|
|
|
|
void gotInferiorPid(qint64 pid, Utils::Port qmlPort);
|
2013-04-25 16:02:17 +02:00
|
|
|
void appOutput(const QString &output);
|
|
|
|
|
void errorMsg(const QString &msg);
|
|
|
|
|
void finished(bool cleanExit);
|
2015-09-11 13:32:45 +02:00
|
|
|
|
|
|
|
|
private:
|
2013-04-25 16:02:17 +02:00
|
|
|
void handleDidStartApp(Ios::IosToolHandler *handler, const QString &bundlePath,
|
|
|
|
|
const QString &deviceId, Ios::IosToolHandler::OpStatus status);
|
2014-02-25 22:48:19 +01:00
|
|
|
void handleGotServerPorts(Ios::IosToolHandler *handler, const QString &bundlePath,
|
2016-04-19 16:43:30 +02:00
|
|
|
const QString &deviceId, Utils::Port gdbPort, Utils::Port qmlPort);
|
2013-04-25 16:02:17 +02:00
|
|
|
void handleGotInferiorPid(Ios::IosToolHandler *handler, const QString &bundlePath,
|
2015-09-11 13:13:04 +02:00
|
|
|
const QString &deviceId, qint64 pid);
|
2013-04-25 16:02:17 +02:00
|
|
|
void handleAppOutput(Ios::IosToolHandler *handler, const QString &output);
|
|
|
|
|
void handleErrorMsg(Ios::IosToolHandler *handler, const QString &msg);
|
|
|
|
|
void handleToolExited(Ios::IosToolHandler *handler, int code);
|
|
|
|
|
void handleFinished(Ios::IosToolHandler *handler);
|
2015-09-11 13:32:45 +02:00
|
|
|
|
2013-04-25 16:02:17 +02:00
|
|
|
IosToolHandler *m_toolHandler;
|
|
|
|
|
QString m_bundleDir;
|
|
|
|
|
QStringList m_arguments;
|
|
|
|
|
ProjectExplorer::IDevice::ConstPtr m_device;
|
2014-11-12 19:41:59 +01:00
|
|
|
IosDeviceType m_deviceType;
|
2014-02-25 22:48:19 +01:00
|
|
|
bool m_cppDebug;
|
2015-08-10 17:43:58 +02:00
|
|
|
QmlDebug::QmlDebugServicesPreset m_qmlDebugServices;
|
|
|
|
|
|
2013-04-25 16:02:17 +02:00
|
|
|
bool m_cleanExit;
|
2016-04-19 16:43:30 +02:00
|
|
|
Utils::Port m_qmlPort;
|
2015-09-11 13:13:04 +02:00
|
|
|
qint64 m_pid;
|
2013-04-25 16:02:17 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace Internal
|
|
|
|
|
} // namespace Ios
|