Launch adb in its own working directory

* This means if we're launching a system copy of adb, we don't have a dangling
  process holding a reference to our folder. Mostly relevant during development
  when we might want to clear the build but adb is running keeping the folder
  alive.
This commit is contained in:
baldurk
2019-03-05 17:53:46 +00:00
parent a893b48aea
commit e7ef61b15c
+5 -1
View File
@@ -327,7 +327,11 @@ void initAdb()
{
// we don't use adbExecCommand because we need to be sure we don't wait for it to exit
std::string adb = getToolPath(ToolDir::PlatformTools, "adb", false);
Process::LaunchProcess(adb.c_str(), ".", "start-server", true);
std::string workdir = ".";
if(adb.find('/') != std::string::npos || adb.find('\\') != std::string::npos)
workdir = dirname(adb);
Process::LaunchProcess(adb.c_str(), workdir.c_str(), "start-server", true);
}
void shutdownAdb()
{