| 337 | return execCommand(adb, deviceArgs, workDir, silent); |
| 338 | } |
| 339 | void 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 | } |
| 365 | void shutdownAdb() |
| 366 | { |
| 367 | if(adbKillServer) |
no test coverage detected