From d9915388c729be4be615f654032aafff28ca7094 Mon Sep 17 00:00:00 2001 From: Omar El Sheikh Date: Mon, 21 Dec 2020 14:40:38 -0500 Subject: [PATCH] Add check for Android Version We need to check the android version running on the device to know whether or not we need to make the adb install command use the --force-queryable flag Devices running Android R/11/SDK 30 are ones which support this flag --- renderdoc/android/android.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/renderdoc/android/android.cpp b/renderdoc/android/android.cpp index b9f4101ab..b9a2d61b4 100644 --- a/renderdoc/android/android.cpp +++ b/renderdoc/android/android.cpp @@ -413,8 +413,20 @@ ReplayStatus InstallRenderDocServer(const rdcstr &deviceID) "%s missing - ensure you build all ABIs your device can support for full compatibility", apk.c_str()); - Process::ProcessResult adbInstall = - adbExecCommand(deviceID, "install -r -g --force-queryable \"" + apk + "\""); + rdcstr api = + Android::adbExecCommand(deviceID, "shell getprop ro.build.version.sdk").strStdout.trimmed(); + + int apiVersion = atoi(api.c_str()); + + Process::ProcessResult adbInstall; + if(apiVersion >= 30) + { + adbInstall = adbExecCommand(deviceID, "install -r -g --force-queryable \"" + apk + "\""); + } + else + { + adbInstall = adbExecCommand(deviceID, "install -r -g \"" + apk + "\""); + } RDCLOG("Installed package '%s', checking for success...", apk.c_str());