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
This commit is contained in:
Omar El Sheikh
2020-12-21 14:40:38 -05:00
committed by Baldur Karlsson
parent 050e9e1bba
commit d9915388c7
+14 -2
View File
@@ -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());