mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-29 13:20:54 +00:00
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:
@@ -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++;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user