Android: make sure to remove the adb daemon logs from devices list

Fixes: QTCREATORBUG-21797
Change-Id: I9153a5b2a0da4826179b436945fcc4616d65bb25
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
This commit is contained in:
Assam Boudjelthia
2020-05-18 10:43:06 +03:00
parent 625a8f3eca
commit 2c6563c69d
2 changed files with 7 additions and 4 deletions

View File

@@ -617,8 +617,9 @@ QVector<AndroidDeviceInfo> AndroidConfig::connectedDevices(const FilePath &adbTo
if (adbDevs.empty())
return devices;
while (adbDevs.first().startsWith("* daemon"))
adbDevs.removeFirst(); // remove the daemon logs
for (const QString line : adbDevs) // remove the daemon logs
if (line.startsWith("* daemon"))
adbDevs.removeOne(line);
adbDevs.removeFirst(); // remove "List of devices attached" header line
// workaround for '????????????' serial numbers:

View File

@@ -206,8 +206,10 @@ AndroidDeviceInfoList AndroidToolManager::androidVirtualDevices(const Utils::Fil
if (avds.empty())
return devices;
while (avds.first().startsWith(QLatin1String("* daemon")))
avds.removeFirst(); // remove the daemon logs
for (const QString line : avds) // remove the daemon logs
if (line.startsWith("* daemon"))
avds.removeOne(line);
avds.removeFirst(); // remove "List of devices attached" header line
bool nextLineIsTargetLine = false;