From e7ef61b15cdb4671b249f825334b49657b8a2f15 Mon Sep 17 00:00:00 2001 From: baldurk Date: Tue, 5 Mar 2019 17:53:46 +0000 Subject: [PATCH] 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. --- renderdoc/android/android_tools.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/renderdoc/android/android_tools.cpp b/renderdoc/android/android_tools.cpp index 93f75f68e..4ce21eb20 100644 --- a/renderdoc/android/android_tools.cpp +++ b/renderdoc/android/android_tools.cpp @@ -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() {