forked from qt-creator/qt-creator
Android: Log Qt live apk path and few more code paths
Change-Id: Id743db4865b399c619c04fc393540758352c60e1 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
@@ -1287,4 +1287,13 @@ void AndroidConfigurations::updateAndroidDevice()
|
|||||||
|
|
||||||
AndroidConfigurations *AndroidConfigurations::m_instance = 0;
|
AndroidConfigurations *AndroidConfigurations::m_instance = 0;
|
||||||
|
|
||||||
|
QDebug &operator<<(QDebug &stream, const AndroidDeviceInfo &device)
|
||||||
|
{
|
||||||
|
stream << "Type:"<< (device.type == AndroidDeviceInfo::Emulator ? "Emulator" : "Device")
|
||||||
|
<< ", ABI:" << device.cpuAbi << ", Serial:" << device.serialNumber
|
||||||
|
<< ", Name:" << device.avdname << ", API:" << device.sdk
|
||||||
|
<< ", Authorised:" << !device.unauthorized;
|
||||||
|
return stream;
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace Android
|
} // namespace Android
|
||||||
|
@@ -229,6 +229,8 @@ private:
|
|||||||
bool m_force32bit;
|
bool m_force32bit;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
QDebug &operator<<(QDebug &stream, const AndroidDeviceInfo &device);
|
||||||
|
|
||||||
} // namespace Android
|
} // namespace Android
|
||||||
|
|
||||||
Q_DECLARE_METATYPE(Android::AndroidDeviceInfo)
|
Q_DECLARE_METATYPE(Android::AndroidDeviceInfo)
|
||||||
|
@@ -123,6 +123,8 @@ bool AndroidDeployQtStep::init(QList<const BuildStep *> &earlierSteps)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
emit addOutput(tr("initializing deployment to Android device/simulator"), OutputFormat::Stdout);
|
||||||
|
|
||||||
RunConfiguration *rc = target()->activeRunConfiguration();
|
RunConfiguration *rc = target()->activeRunConfiguration();
|
||||||
QTC_ASSERT(rc, return false);
|
QTC_ASSERT(rc, return false);
|
||||||
const bool deployQtLive = rc->id().name().startsWith(qmlProjectRunConfigIdName);
|
const bool deployQtLive = rc->id().name().startsWith(qmlProjectRunConfigIdName);
|
||||||
@@ -135,10 +137,12 @@ bool AndroidDeployQtStep::init(QList<const BuildStep *> &earlierSteps)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
int deviceAPILevel = AndroidManager::minimumSDK(target());
|
int minTargetApi = AndroidManager::minimumSDK(target());
|
||||||
|
qCDebug(deployStepLog) << "Target architecture:" << m_targetArch
|
||||||
|
<< "Min target API" << minTargetApi;
|
||||||
AndroidDeviceInfo info = earlierDeviceInfo(earlierSteps, Id);
|
AndroidDeviceInfo info = earlierDeviceInfo(earlierSteps, Id);
|
||||||
if (!info.isValid()) {
|
if (!info.isValid()) {
|
||||||
info = AndroidConfigurations::showDeviceDialog(project(), deviceAPILevel, m_targetArch);
|
info = AndroidConfigurations::showDeviceDialog(project(), minTargetApi, m_targetArch);
|
||||||
m_deviceInfo = info; // Keep around for later steps
|
m_deviceInfo = info; // Keep around for later steps
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -147,7 +151,7 @@ bool AndroidDeployQtStep::init(QList<const BuildStep *> &earlierSteps)
|
|||||||
|
|
||||||
m_avdName = info.avdname;
|
m_avdName = info.avdname;
|
||||||
m_serialNumber = info.serialNumber;
|
m_serialNumber = info.serialNumber;
|
||||||
qCDebug(deployStepLog) << "AVD:" << m_avdName << "Device Serial:" << m_serialNumber;
|
qCDebug(deployStepLog) << "Selected Device:" << info;
|
||||||
|
|
||||||
if (!deployQtLive)
|
if (!deployQtLive)
|
||||||
gatherFilesToPull();
|
gatherFilesToPull();
|
||||||
@@ -155,6 +159,8 @@ bool AndroidDeployQtStep::init(QList<const BuildStep *> &earlierSteps)
|
|||||||
AndroidManager::setDeviceSerialNumber(target(), m_serialNumber);
|
AndroidManager::setDeviceSerialNumber(target(), m_serialNumber);
|
||||||
AndroidManager::setDeviceApiLevel(target(), info.sdk);
|
AndroidManager::setDeviceApiLevel(target(), info.sdk);
|
||||||
|
|
||||||
|
emit addOutput(tr("Deploying to %1").arg(m_serialNumber), OutputFormat::Stdout);
|
||||||
|
|
||||||
QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(target()->kit());
|
QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(target()->kit());
|
||||||
if (!version)
|
if (!version)
|
||||||
return false;
|
return false;
|
||||||
|
@@ -34,9 +34,14 @@
|
|||||||
#include <utils/url.h>
|
#include <utils/url.h>
|
||||||
|
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
|
#include <QLoggingCategory>
|
||||||
|
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
Q_LOGGING_CATEGORY(androidDeviceLog, "qtc.android.build.androiddevice")
|
||||||
|
}
|
||||||
|
|
||||||
namespace Android {
|
namespace Android {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
@@ -51,6 +56,8 @@ AndroidDevice::AndroidDevice()
|
|||||||
QString activityPath;
|
QString activityPath;
|
||||||
const AndroidConfig &config = AndroidConfigurations::currentConfig();
|
const AndroidConfig &config = AndroidConfigurations::currentConfig();
|
||||||
AndroidManager::apkInfo(config.qtLiveApkPath(), nullptr, nullptr, &activityPath);
|
AndroidManager::apkInfo(config.qtLiveApkPath(), nullptr, nullptr, &activityPath);
|
||||||
|
qCDebug(androidDeviceLog) << "Using Qt live apk from: " << config.qtLiveApkPath()
|
||||||
|
<< "Activity Path:" << activityPath;
|
||||||
setQmlsceneCommand(activityPath);
|
setQmlsceneCommand(activityPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -210,6 +210,7 @@ void AndroidRunner::qmlServerPortReady(Port port)
|
|||||||
serverUrl.setHost(QHostAddress(QHostAddress::LocalHost).toString());
|
serverUrl.setHost(QHostAddress(QHostAddress::LocalHost).toString());
|
||||||
serverUrl.setPort(port.number());
|
serverUrl.setPort(port.number());
|
||||||
serverUrl.setScheme(urlTcpScheme());
|
serverUrl.setScheme(urlTcpScheme());
|
||||||
|
qCDebug(androidRunnerLog) << "Qml Server port ready"<< serverUrl;
|
||||||
emit qmlServerReady(serverUrl);
|
emit qmlServerReady(serverUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user