Switch android device to root as early as possible

* Running 'adb root' will cause the device to disconnect, so doing it late when
  we're selecting an app to debug and want to see if we have debug access means
  we'll kill our server connection the first time. Instead doing it at enumerate
  time means the device will already be in root mode.
This commit is contained in:
baldurk
2019-03-27 18:22:37 +00:00
parent d519f086e1
commit be998744b3
+6
View File
@@ -584,6 +584,12 @@ extern "C" RENDERDOC_API void RENDERDOC_CC RENDERDOC_EnumerateAndroidDevices(rdc
// Forward the ports so we can see if a remoteserver/captured app is already running.
Android::adbForwardPorts(idx, tokens[0], 0, 0, true);
// run adb root now, so we hit any disconnection that we're going to before trying to connect.
// If we can't be root, this is cheap, if we're already root, this is cheap, if we can be root
// and this changes us it will block only the first time - and we expect this function to be
// slow-ish.
Android::adbExecCommand(tokens[0], "root");
idx++;
}
}