Commit 095d9114 authored by Daniel Teske's avatar Daniel Teske

Android: Skip boot to qt devices

Change-Id: Ibce483484975e2817ad28ce00ea1f2d9ae06a497
Reviewed-by: default avatarMitch Curtis <mitch.curtis@digia.com>
parent 899dac18
......@@ -470,6 +470,8 @@ QVector<AndroidDeviceInfo> AndroidConfigurations::connectedDevices(QString *erro
foreach (const QByteArray &device, adbDevs) {
const QString serialNo = QString::fromLatin1(device.left(device.indexOf('\t')).trimmed());
const QString deviceType = QString::fromLatin1(device.mid(device.indexOf('\t'))).trimmed();
if (isBootToQt(serialNo))
continue;
AndroidDeviceInfo dev;
dev.serialNumber = serialNo;
dev.type = serialNo.startsWith(QLatin1String("emulator")) ? AndroidDeviceInfo::Emulator : AndroidDeviceInfo::Hardware;
......@@ -689,6 +691,22 @@ QString AndroidConfigurations::waitForAvd(int apiLevel, const QString &cpuAbi) c
return QString();
}
bool AndroidConfigurations::isBootToQt(const QString &device) const
{
// workaround for '????????????' serial numbers
QStringList arguments = AndroidDeviceInfo::adbSelector(device);
arguments << QLatin1String("shell")
<< QLatin1String("ls -l /system/bin/appcontroller || ls -l /usr/bin/appcontroller && echo Boot2Qt");
QProcess adbProc;
adbProc.start(adbToolPath().toString(), arguments);
if (!adbProc.waitForFinished(-1)) {
adbProc.kill();
return -1;
}
return adbProc.readAll().contains("Boot2Qt");
}
int AndroidConfigurations::getSDKVersion(const QString &device) const
{
// workaround for '????????????' serial numbers
......
......@@ -146,6 +146,7 @@ private:
int getSDKVersion(const QString &device) const;
QStringList getAbis(const QString &device) const;
bool isBootToQt(const QString &device) const;
void updateAvailableNdkPlatforms();
void updateAvailableSdkPlatforms();
......
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