| 403 | } |
| 404 | |
| 405 | RDResult InstallRenderDocServer(const rdcstr &deviceID) |
| 406 | { |
| 407 | ResultCode result = ResultCode::Succeeded; |
| 408 | |
| 409 | rdcarray<ABI> abis = GetSupportedABIs(deviceID); |
| 410 | |
| 411 | if(abis.empty()) |
| 412 | { |
| 413 | RETURN_ERROR_RESULT(ResultCode::AndroidABINotFound, |
| 414 | "Couldn't determine supported ABIs for device %s", deviceID.c_str()); |
| 415 | } |
| 416 | |
| 417 | // Check known paths for RenderDoc server |
| 418 | rdcstr libPath; |
| 419 | FileIO::GetLibraryFilename(libPath); |
| 420 | rdcstr libDir = get_dirname(FileIO::GetFullPathname(libPath)); |
| 421 | |
| 422 | rdcarray<rdcstr> paths; |
| 423 | |
| 424 | #if defined(RENDERDOC_APK_PATH) |
| 425 | rdcstr customPath(RENDERDOC_APK_PATH); |
| 426 | #else |
| 427 | rdcstr customPath; |
| 428 | #endif |
| 429 | |
| 430 | if(!customPath.empty()) |
| 431 | { |
| 432 | RDCLOG("Custom APK path: %s", customPath.c_str()); |
| 433 | |
| 434 | if(FileIO::IsRelativePath(customPath)) |
| 435 | customPath = libDir + "/" + customPath; |
| 436 | |
| 437 | if(customPath.back() != '/') |
| 438 | customPath += '/'; |
| 439 | |
| 440 | paths.push_back(customPath); |
| 441 | } |
| 442 | |
| 443 | rdcstr suff = GetPlainABIName(abis[0]); |
| 444 | |
| 445 | paths.push_back(libDir + "/plugins/android/"); // Windows install |
| 446 | paths.push_back(libDir + "/../share/renderdoc/plugins/android/"); // Linux install |
| 447 | paths.push_back(libDir + "/../plugins/android/"); // macOS install |
| 448 | paths.push_back(libDir + "/../../build-android/bin/"); // Local build |
| 449 | paths.push_back(libDir + "/../../build-android-" + suff + "/bin/"); // Local ABI build |
| 450 | paths.push_back(libDir + "/../../../../../build-android/bin/"); // macOS build |
| 451 | paths.push_back(libDir + "/../../../../../build-android-" + suff + "/bin/"); // macOS ABI build |
| 452 | |
| 453 | // use the first ABI for searching |
| 454 | rdcstr apk = GetRenderDocPackageForABI(abis[0]); |
| 455 | rdcstr apksFolder; |
| 456 | |
| 457 | for(uint32_t i = 0; i < paths.size(); i++) |
| 458 | { |
| 459 | RDCLOG("Checking for server APK in %s", paths[i].c_str()); |
| 460 | |
| 461 | rdcstr apkpath = paths[i] + apk + ".apk"; |
| 462 |
no test coverage detected