Android: Launch "adb track-devices" with explicit working directory

Since no working directory was explicitly set, the "bin/" directory of
QtC was chosen as working directory.

"adb track-devices" leaves the server process alive after terminating,
and that server process used QtC's working directory. On Windows, that
caused that directory to be undeletable/unmovable as long as the adb
server was alive.

This change sets the working directory of "adb track-devices" to the
parent dir of the adb binary.

Task-number: QTCREATORBUG-28932
Change-Id: I3adf52829c9f4bf456d05d2685c04314e1d25a40
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
This commit is contained in:
Alessandro Portale
2023-03-24 14:28:16 +01:00
parent 01b2108697
commit f7639f458a

View File

@@ -645,6 +645,7 @@ void AndroidDeviceManager::setupDevicesWatcher()
const CommandLine command = CommandLine(m_androidConfig.adbToolPath(), {"track-devices"});
m_adbDeviceWatcherProcess->setCommand(command);
m_adbDeviceWatcherProcess->setWorkingDirectory(command.executable().parentDir());
m_adbDeviceWatcherProcess->setEnvironment(AndroidConfigurations::toolsEnvironment(m_androidConfig));
m_adbDeviceWatcherProcess->start();