iOS: Fix slow debugging with recent Xcode and iOS < 17

When starting the debugger, we need to pass it the location of the
downloaded device symbols, or otherwise debugger startup is very slow.

Xcode changes the location where it saves this information once in a
while, and it must have again. The location with Xcode 15.2 at least is
in the style "iPhone8,1 15.7.3 (19H307)", i.e. it starts with the
"product type" now.

Retrieve the product type of the device and add another candidate
directory for device symbols.

Fixes: QTCREATORBUG-31044
Change-Id: I1a65305fc84c1af8cd48c4ebb249167e1dbe6ae1
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
Eike Ziller
2024-06-12 10:44:25 +02:00
parent b599edb9b7
commit caa5c3947f
7 changed files with 24 additions and 8 deletions

View File

@@ -813,14 +813,17 @@ void IosDebugSupport::start()
setStartMode(AttachToRemoteProcess);
setIosPlatform("remote-ios");
const QString osVersion = dev->osVersion();
const QString productType = dev->productType();
const QString cpuArchitecture = dev->cpuArchitecture();
const FilePaths symbolsPathCandidates = {
FilePath::fromString(QDir::homePath() + "/Library/Developer/Xcode/iOS DeviceSupport/"
+ osVersion + " " + cpuArchitecture + "/Symbols"),
FilePath::fromString(QDir::homePath() + "/Library/Developer/Xcode/iOS DeviceSupport/"
+ osVersion + "/Symbols"),
IosConfigurations::developerPath().pathAppended(
"Platforms/iPhoneOS.platform/DeviceSupport/" + osVersion + "/Symbols")};
const FilePath home = FilePath::fromString(QDir::homePath());
const FilePaths symbolsPathCandidates
= {home / "Library/Developer/Xcode/iOS DeviceSupport" / (productType + " " + osVersion)
/ "Symbols",
home / "Library/Developer/Xcode/iOS DeviceSupport"
/ (osVersion + " " + cpuArchitecture) / "Symbols",
home / "Library/Developer/Xcode/iOS DeviceSupport" / osVersion / "Symbols",
IosConfigurations::developerPath() / "Platforms/iPhoneOS.platform/DeviceSupport"
/ osVersion / "Symbols"};
const FilePath deviceSdk = Utils::findOrDefault(symbolsPathCandidates, &FilePath::isDir);
if (deviceSdk.isEmpty()) {