mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-09-22 21:55:52 +00:00
Make adb devices execute silently because otherwise it spams the log
This commit is contained in:
@@ -458,7 +458,7 @@ extern "C" RENDERDOC_API void RENDERDOC_CC RENDERDOC_GetAndroidFriendlyName(cons
|
||||
|
||||
extern "C" RENDERDOC_API void RENDERDOC_CC RENDERDOC_EnumerateAndroidDevices(rdcstr *deviceList)
|
||||
{
|
||||
std::string adbStdout = Android::adbExecCommand("", "devices").strStdout;
|
||||
std::string adbStdout = Android::adbExecCommand("", "devices", ".", true).strStdout;
|
||||
|
||||
int idx = 0;
|
||||
|
||||
|
||||
@@ -34,6 +34,6 @@ bool IsHostADB(const char *hostname);
|
||||
uint32_t StartAndroidPackageForCapture(const char *host, const char *package);
|
||||
void ExtractDeviceIDAndIndex(const std::string &hostname, int &index, std::string &deviceID);
|
||||
Process::ProcessResult adbExecCommand(const std::string &deviceID, const std::string &args,
|
||||
const string &workDir = ".");
|
||||
const string &workDir = ".", bool silent = false);
|
||||
bool InjectWithJDWP(const std::string &deviceID, uint16_t jdwpport);
|
||||
};
|
||||
|
||||
@@ -267,25 +267,27 @@ std::string getToolPath(ToolDir subdir, const std::string &toolname, bool checkE
|
||||
return toolname;
|
||||
}
|
||||
Process::ProcessResult execScript(const std::string &script, const std::string &args,
|
||||
const std::string &workDir)
|
||||
const std::string &workDir, bool silent)
|
||||
{
|
||||
RDCLOG("SCRIPT: %s", script.c_str());
|
||||
if(!silent)
|
||||
RDCLOG("SCRIPT: %s", script.c_str());
|
||||
|
||||
Process::ProcessResult result;
|
||||
Process::LaunchScript(script.c_str(), workDir.c_str(), args.c_str(), true, &result);
|
||||
return result;
|
||||
}
|
||||
Process::ProcessResult execCommand(const std::string &exe, const std::string &args,
|
||||
const std::string &workDir)
|
||||
const std::string &workDir, bool silent)
|
||||
{
|
||||
RDCLOG("COMMAND: %s '%s'", exe.c_str(), args.c_str());
|
||||
if(!silent)
|
||||
RDCLOG("COMMAND: %s '%s'", exe.c_str(), args.c_str());
|
||||
|
||||
Process::ProcessResult result;
|
||||
Process::LaunchProcess(exe.c_str(), workDir.c_str(), args.c_str(), true, &result);
|
||||
return result;
|
||||
}
|
||||
Process::ProcessResult adbExecCommand(const std::string &device, const std::string &args,
|
||||
const std::string &workDir)
|
||||
const std::string &workDir, bool silent)
|
||||
{
|
||||
std::string adb = getToolPath(ToolDir::PlatformTools, "adb", false);
|
||||
Process::ProcessResult result;
|
||||
@@ -294,6 +296,6 @@ Process::ProcessResult adbExecCommand(const std::string &device, const std::stri
|
||||
deviceArgs = args;
|
||||
else
|
||||
deviceArgs = StringFormat::Fmt("-s %s %s", device.c_str(), args.c_str());
|
||||
return execCommand(adb, deviceArgs, workDir);
|
||||
return execCommand(adb, deviceArgs, workDir, silent);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -32,9 +32,9 @@
|
||||
namespace Android
|
||||
{
|
||||
Process::ProcessResult execScript(const string &script, const string &args,
|
||||
const string &workDir = ".");
|
||||
const string &workDir = ".", bool silent = false);
|
||||
Process::ProcessResult execCommand(const string &exe, const string &args,
|
||||
const string &workDir = ".");
|
||||
const string &workDir = ".", bool silent = false);
|
||||
|
||||
enum class ToolDir
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user