From 9a94ec03cd5e36bf7706aa444b7513e949efc558 Mon Sep 17 00:00:00 2001 From: baldurk Date: Mon, 22 Apr 2019 10:28:19 +0100 Subject: [PATCH] Add a message if adb couldn't be found, reduce windows error spam --- renderdoc/android/android_tools.cpp | 10 ++++++++++ renderdoc/os/win32/win32_process.cpp | 6 ++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/renderdoc/android/android_tools.cpp b/renderdoc/android/android_tools.cpp index c6eeb6bd3..c4ceb56ae 100644 --- a/renderdoc/android/android_tools.cpp +++ b/renderdoc/android/android_tools.cpp @@ -331,6 +331,16 @@ void initAdb() if(adb.find('/') != std::string::npos || adb.find('\\') != std::string::npos) workdir = get_dirname(adb); + RDCLOG("Initialising adb using '%s'", adb.c_str()); + + if(adb.empty() || !FileIO::exists(adb.c_str()) || !FileIO::exists((adb + ".exe").c_str())) + { + if(FileIO::FindFileInPath(adb.c_str()) == "") + RDCWARN( + "Couldn't locate adb. Ensure adb is in PATH, ANDROID_SDK or ANDROID_HOME is set, or you " + "configure your SDK location"); + } + Process::LaunchProcess(adb.c_str(), workdir.c_str(), "start-server", true); } void shutdownAdb() diff --git a/renderdoc/os/win32/win32_process.cpp b/renderdoc/os/win32/win32_process.cpp index 20d4d55bb..54500f59e 100644 --- a/renderdoc/os/win32/win32_process.cpp +++ b/renderdoc/os/win32/win32_process.cpp @@ -556,7 +556,8 @@ static PROCESS_INFORMATION RunProcess(const char *app, const char *workingDir, c if(!retValue) { - RDCWARN("Process %s could not be loaded.", app); + if(!internal) + RDCWARN("Process %s could not be loaded.", app); CloseHandle(pi.hProcess); CloseHandle(pi.hThread); RDCEraseEl(pi); @@ -1003,7 +1004,8 @@ uint32_t Process::LaunchProcess(const char *app, const char *workingDir, const c if(pi.dwProcessId == 0) { - RDCWARN("Couldn't launch process '%s'", app); + if(!internal) + RDCWARN("Couldn't launch process '%s'", app); return 0; }