MCPcopy Create free account
hub / github.com/baldurk/renderdoc / initAdb

Function initAdb

renderdoc/android/android_tools.cpp:339–364  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

337 return execCommand(adb, deviceArgs, workDir, silent);
338}
339void initAdb()
340{
341 // we don't use adbExecCommand because we need to be sure we don't wait for it to exit
342 rdcstr adb = getToolPath(ToolDir::PlatformTools, "adb", false);
343 rdcstr workdir = ".";
344 if(adb.contains('/') || adb.contains('\\'))
345 workdir = get_dirname(adb);
346
347 RDCLOG("Initialising adb using '%s'", adb.c_str());
348
349 if(adb.empty() || (!FileIO::exists(adb) && !FileIO::exists(adb + ".exe")))
350 {
351 if(FileIO::FindFileInPath(adb) == "")
352 RDCWARN(
353 "Couldn't locate adb. Ensure adb is in PATH, ANDROID_SDK or ANDROID_HOME is set, or you "
354 "configure your SDK location");
355 }
356
357 Process::ProcessResult res = {};
358 Process::LaunchProcess(adb, workdir, "start-server", true, &res);
359
360 if(res.strStdout.find("daemon") >= 0 || res.strStderror.find("daemon") >= 0)
361 {
362 RDCLOG("Started adb server");
363 }
364}
365void shutdownAdb()
366{
367 if(adbKillServer)

Callers 1

StartMethod · 0.85

Calls 8

getToolPathFunction · 0.85
get_dirnameFunction · 0.85
existsFunction · 0.50
FindFileInPathFunction · 0.50
containsMethod · 0.45
c_strMethod · 0.45
emptyMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected