diff --git a/src/plugins/android/androidpackageinstallationstep.cpp b/src/plugins/android/androidpackageinstallationstep.cpp index 629c857a90e..7b69ac34674 100644 --- a/src/plugins/android/androidpackageinstallationstep.cpp +++ b/src/plugins/android/androidpackageinstallationstep.cpp @@ -31,6 +31,11 @@ #include "androidmanager.h" #include +#include +#include +#include + +#include using namespace Android::Internal; @@ -50,6 +55,14 @@ AndroidPackageInstallationStep::AndroidPackageInstallationStep(ProjectExplorer:: bool AndroidPackageInstallationStep::init() { - setUserArguments(QString::fromLatin1("INSTALL_ROOT=\"%1\" install").arg(AndroidManager::dirPath(target()).toUserOutput())); + ProjectExplorer::BuildConfiguration *bc = buildConfiguration(); + if (!bc) + bc = target()->activeBuildConfiguration(); + QString dirPath = AndroidManager::dirPath(target()).toString(); + if (Utils::HostOsInfo::isWindowsHost()) + if (bc->environment().searchInPath(QLatin1String("sh.exe")).isEmpty()) + dirPath = QDir::toNativeSeparators(dirPath); + setUserArguments(QString::fromLatin1("INSTALL_ROOT=\"%1\" install").arg(dirPath)); + return MakeStep::init(); }