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;
|
||||
|
||||
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
|
||||
|
@@ -229,6 +229,8 @@ private:
|
||||
bool m_force32bit;
|
||||
};
|
||||
|
||||
QDebug &operator<<(QDebug &stream, const AndroidDeviceInfo &device);
|
||||
|
||||
} // namespace Android
|
||||
|
||||
Q_DECLARE_METATYPE(Android::AndroidDeviceInfo)
|
||||
|
@@ -123,6 +123,8 @@ bool AndroidDeployQtStep::init(QList<const BuildStep *> &earlierSteps)
|
||||
return false;
|
||||
}
|
||||
|
||||
emit addOutput(tr("initializing deployment to Android device/simulator"), OutputFormat::Stdout);
|
||||
|
||||
RunConfiguration *rc = target()->activeRunConfiguration();
|
||||
QTC_ASSERT(rc, return false);
|
||||
const bool deployQtLive = rc->id().name().startsWith(qmlProjectRunConfigIdName);
|
||||
@@ -135,10 +137,12 @@ bool AndroidDeployQtStep::init(QList<const BuildStep *> &earlierSteps)
|
||||
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);
|
||||
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
|
||||
}
|
||||
|
||||
@@ -147,7 +151,7 @@ bool AndroidDeployQtStep::init(QList<const BuildStep *> &earlierSteps)
|
||||
|
||||
m_avdName = info.avdname;
|
||||
m_serialNumber = info.serialNumber;
|
||||
qCDebug(deployStepLog) << "AVD:" << m_avdName << "Device Serial:" << m_serialNumber;
|
||||
qCDebug(deployStepLog) << "Selected Device:" << info;
|
||||
|
||||
if (!deployQtLive)
|
||||
gatherFilesToPull();
|
||||
@@ -155,6 +159,8 @@ bool AndroidDeployQtStep::init(QList<const BuildStep *> &earlierSteps)
|
||||
AndroidManager::setDeviceSerialNumber(target(), m_serialNumber);
|
||||
AndroidManager::setDeviceApiLevel(target(), info.sdk);
|
||||
|
||||
emit addOutput(tr("Deploying to %1").arg(m_serialNumber), OutputFormat::Stdout);
|
||||
|
||||
QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(target()->kit());
|
||||
if (!version)
|
||||
return false;
|
||||
|
@@ -34,9 +34,14 @@
|
||||
#include <utils/url.h>
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QLoggingCategory>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
|
||||
namespace {
|
||||
Q_LOGGING_CATEGORY(androidDeviceLog, "qtc.android.build.androiddevice")
|
||||
}
|
||||
|
||||
namespace Android {
|
||||
namespace Internal {
|
||||
|
||||
@@ -51,6 +56,8 @@ AndroidDevice::AndroidDevice()
|
||||
QString activityPath;
|
||||
const AndroidConfig &config = AndroidConfigurations::currentConfig();
|
||||
AndroidManager::apkInfo(config.qtLiveApkPath(), nullptr, nullptr, &activityPath);
|
||||
qCDebug(androidDeviceLog) << "Using Qt live apk from: " << config.qtLiveApkPath()
|
||||
<< "Activity Path:" << activityPath;
|
||||
setQmlsceneCommand(activityPath);
|
||||
}
|
||||
|
||||
|
@@ -210,6 +210,7 @@ void AndroidRunner::qmlServerPortReady(Port port)
|
||||
serverUrl.setHost(QHostAddress(QHostAddress::LocalHost).toString());
|
||||
serverUrl.setPort(port.number());
|
||||
serverUrl.setScheme(urlTcpScheme());
|
||||
qCDebug(androidRunnerLog) << "Qml Server port ready"<< serverUrl;
|
||||
emit qmlServerReady(serverUrl);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user