| 1121 | } |
| 1122 | |
| 1123 | ResultDetails StartRemoteServer(const rdcstr &URL) override |
| 1124 | { |
| 1125 | RDResult result = ResultCode::Succeeded; |
| 1126 | |
| 1127 | Invoke([this, &result, URL]() { |
| 1128 | rdcstr deviceID = GetDeviceID(URL); |
| 1129 | |
| 1130 | auto it = devices.find(deviceID); |
| 1131 | if(it == devices.end()) |
| 1132 | { |
| 1133 | SET_ERROR_RESULT(result, ResultCode::InternalError, |
| 1134 | "Android device %s is not a valid device ID, can't launch server", |
| 1135 | Android::GetFriendlyName(deviceID).c_str()); |
| 1136 | return; |
| 1137 | } |
| 1138 | |
| 1139 | Device &dev = it->second; |
| 1140 | |
| 1141 | if(!dev.active) |
| 1142 | { |
| 1143 | SET_ERROR_RESULT(result, ResultCode::InternalError, |
| 1144 | "Android device %s is not active, can't launch server", |
| 1145 | Android::GetFriendlyName(deviceID).c_str()); |
| 1146 | return; |
| 1147 | } |
| 1148 | |
| 1149 | rdcstr packagesOutput = |
| 1150 | Android::ListPackages(deviceID, RENDERDOC_ANDROID_PACKAGE_BASE).strStdout.trimmed(); |
| 1151 | |
| 1152 | rdcarray<rdcstr> packages; |
| 1153 | split(packagesOutput, packages, '\n'); |
| 1154 | |
| 1155 | rdcarray<Android::ABI> abis = Android::GetSupportedABIs(deviceID); |
| 1156 | |
| 1157 | RDCLOG("Starting RenderDoc server, supported ABIs:"); |
| 1158 | for(Android::ABI abi : abis) |
| 1159 | RDCLOG(" - %s", ToStr(abi).c_str()); |
| 1160 | |
| 1161 | if(abis.empty()) |
| 1162 | { |
| 1163 | SET_ERROR_RESULT(result, ResultCode::AndroidABINotFound, |
| 1164 | "Can't determine supported ABIs for device %s", |
| 1165 | Android::GetFriendlyName(deviceID).c_str()); |
| 1166 | return; |
| 1167 | } |
| 1168 | |
| 1169 | rdcstr api = |
| 1170 | Android::adbExecCommand(deviceID, "shell getprop ro.build.version.sdk").strStdout.trimmed(); |
| 1171 | |
| 1172 | int apiVersion = atoi(api.c_str()); |
| 1173 | |
| 1174 | // To account for awkward 64-bit only devices, sometimes need to check ABIs independently. If |
| 1175 | // ARM32 is *missing completely* and ARM64 is present and on the right version, we allow that |
| 1176 | // case on Android 12+ assuming it's a 64-bit only device. Since our installer should always |
| 1177 | // update both packages in lockstep we don't expect 64-bit to be installed only if we could |
| 1178 | // have installed 32-bit. |
| 1179 | |
| 1180 | // the installed version is OK if... |
no test coverage detected