Commit 16908f57 authored by Daniel Teske's avatar Daniel Teske

Android: Make getDeployDeviceSerialNumber not start a avd automatically

This allows the caller to do that as a fallback.

Change-Id: Ifd50036317c7df4fe77fc34ea0f616c07611a517
Reviewed-by: default avatarNikita Baryshnikov <nib952051@gmail.com>
Reviewed-by: default avatarEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
parent 8685ff8a
......@@ -388,7 +388,7 @@ QString AndroidConfigurations::getDeployDeviceSerialNumber(int *apiLevel, const
return device.serialNumber;
}
}
return startAVD(apiLevel);
return QString();
}
QVector<AndroidDeviceInfo> AndroidConfigurations::connectedDevices(int apiLevel) const
......
......@@ -102,6 +102,8 @@ bool AndroidDeployStep::init()
writeOutput(tr("Please wait, searching for a suitable device for target:%1.").arg(targetSDK));
m_deviceAPILevel = targetSDK.mid(targetSDK.indexOf(QLatin1Char('-')) + 1).toInt();
m_deviceSerialNumber = AndroidConfigurations::instance().getDeployDeviceSerialNumber(&m_deviceAPILevel, targetArch);
if (m_deviceSerialNumber.isEmpty())
m_deviceSerialNumber = AndroidConfigurations::instance().startAVD(&m_deviceAPILevel);
if (!m_deviceSerialNumber.length()) {
m_deviceSerialNumber.clear();
raiseError(tr("Cannot deploy: no devices or emulators found for your package."));
......@@ -187,6 +189,8 @@ void AndroidDeployStep::cleanLibsOnDevice()
int deviceAPILevel = targetSDK.mid(targetSDK.indexOf(QLatin1Char('-')) + 1).toInt();
QString deviceSerialNumber = AndroidConfigurations::instance().getDeployDeviceSerialNumber(&deviceAPILevel, targetArch);
if (deviceSerialNumber.isEmpty())
deviceSerialNumber = AndroidConfigurations::instance().startAVD(&deviceAPILevel);
if (!deviceSerialNumber.length()) {
Core::MessageManager::instance()->printToOutputPane(tr("Could not run adb. No device found."), Core::MessageManager::NoModeSwitch);
return;
......@@ -238,6 +242,8 @@ void AndroidDeployStep::installQASIPackage(const QString &packagePath)
const QString targetSDK = AndroidManager::targetSDK(target());
int deviceAPILevel = targetSDK.mid(targetSDK.indexOf(QLatin1Char('-')) + 1).toInt();
QString deviceSerialNumber = AndroidConfigurations::instance().getDeployDeviceSerialNumber(&deviceAPILevel, targetArch);
if (deviceSerialNumber.isEmpty())
deviceSerialNumber = AndroidConfigurations::instance().startAVD(&deviceAPILevel);
if (!deviceSerialNumber.length()) {
Core::MessageManager::instance()->printToOutputPane(tr("Could not run adb. No device found."), Core::MessageManager::NoModeSwitch);
return;
......
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