forked from qt-creator/qt-creator
Android: Fix emulator tool path
In cases where the obsolete "Android SDK Tools" package is installed in addition to the "Android SDK Command-line Tools", the older emulator launcher is called. One reason for that is that the obsolete package has a higher version number than the new one. This change resorts to checking the existence of the new emulator executable and falls back to the old one. Fixes: QTCREATORBUG-28196 Change-Id: I753e0901334a87314a2c8c70fbc69e55dffc500c Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
@@ -471,10 +471,12 @@ FilePath AndroidConfig::adbToolPath() const
|
||||
|
||||
FilePath AndroidConfig::emulatorToolPath() const
|
||||
{
|
||||
QString relativePath = "emulator/emulator";
|
||||
if (sdkToolsVersion() < QVersionNumber(25, 3, 0) && preCmdlineSdkToolsInstalled())
|
||||
relativePath = "tools/emulator";
|
||||
return m_sdkLocation / (relativePath + QTC_HOST_EXE_SUFFIX);
|
||||
const FilePath emulatorFile = m_sdkLocation.pathAppended("emulator/emulator")
|
||||
.withExecutableSuffix();
|
||||
if (emulatorFile.exists())
|
||||
return emulatorFile;
|
||||
|
||||
return m_sdkLocation.pathAppended("tools/emulator").withExecutableSuffix();
|
||||
}
|
||||
|
||||
FilePath AndroidConfig::sdkManagerToolPath() const
|
||||
|
Reference in New Issue
Block a user