diff --git a/src/plugins/ios/iosdevice.cpp b/src/plugins/ios/iosdevice.cpp index d6a6cb2274e..c11794fb963 100644 --- a/src/plugins/ios/iosdevice.cpp +++ b/src/plugins/ios/iosdevice.cpp @@ -171,6 +171,11 @@ QString IosDevice::osVersion() const return m_extraInfo.value(QLatin1String("osVersion")); } +QString IosDevice::cpuArchitecture() const +{ + return m_extraInfo.value("cpuArchitecture"); +} + Utils::Port IosDevice::nextPort() const { // use qrand instead? diff --git a/src/plugins/ios/iosdevice.h b/src/plugins/ios/iosdevice.h index 533a319f32b..329ef8e2687 100644 --- a/src/plugins/ios/iosdevice.h +++ b/src/plugins/ios/iosdevice.h @@ -59,6 +59,7 @@ public: QVariantMap toMap() const override; QString uniqueDeviceID() const; QString osVersion() const; + QString cpuArchitecture() const; Utils::Port nextPort() const; bool canAutoDetectPorts() const override; diff --git a/src/plugins/ios/iosrunner.cpp b/src/plugins/ios/iosrunner.cpp index 1aa5fc52331..61501f9d752 100644 --- a/src/plugins/ios/iosrunner.cpp +++ b/src/plugins/ios/iosrunner.cpp @@ -436,28 +436,26 @@ void IosDebugSupport::start() IosDevice::ConstPtr dev = device().dynamicCast(); setStartMode(AttachToRemoteProcess); setIosPlatform("remote-ios"); - QString osVersion = dev->osVersion(); - FilePath deviceSdk1 = FilePath::fromString(QDir::homePath() - + "/Library/Developer/Xcode/iOS DeviceSupport/" - + osVersion + "/Symbols"); - QString deviceSdk; - if (deviceSdk1.isDir()) { - deviceSdk = deviceSdk1.toString(); - } else { - const FilePath deviceSdk2 = IosConfigurations::developerPath() - .pathAppended("Platforms/iPhoneOS.platform/DeviceSupport/" - + osVersion + "/Symbols"); - if (deviceSdk2.isDir()) { - deviceSdk = deviceSdk2.toString(); - } else { - TaskHub::addTask(DeploymentTask(Task::Warning, tr( - "Could not find device specific debug symbols at %1. " - "Debugging initialization will be slow until you open the Organizer window of " - "Xcode with the device connected to have the symbols generated.") - .arg(deviceSdk1.toUserOutput()))); - } + const QString osVersion = dev->osVersion(); + 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 deviceSdk = Utils::findOrDefault(symbolsPathCandidates, &FilePath::isDir); + + if (deviceSdk.isEmpty()) { + TaskHub::addTask(DeploymentTask( + Task::Warning, + tr("Could not find device specific debug symbols at %1. " + "Debugging initialization will be slow until you open the Organizer window of " + "Xcode with the device connected to have the symbols generated.") + .arg(symbolsPathCandidates.constFirst().toUserOutput()))); } - setDeviceSymbolsRoot(deviceSdk); + setDeviceSymbolsRoot(deviceSdk.toString()); } else { setStartMode(AttachExternal); setIosPlatform("ios-simulator"); diff --git a/src/tools/iostool/iosdevicemanager.cpp b/src/tools/iostool/iosdevicemanager.cpp index 0c09ee61f4a..ce3ff88c4dc 100644 --- a/src/tools/iostool/iosdevicemanager.cpp +++ b/src/tools/iostool/iosdevicemanager.cpp @@ -1593,6 +1593,7 @@ void DevInfoSession::deviceCallbackReturned() QString developerStatusKey = QLatin1String("developerStatus"); QString deviceConnectedKey = QLatin1String("deviceConnected"); QString osVersionKey = QLatin1String("osVersion"); + QString cpuArchitectureKey = "cpuArchitecture"; bool failure = !device; if (!failure) { failure = !connectDevice(); @@ -1631,6 +1632,18 @@ void DevInfoSession::deviceCallbackReturned() 0, CFSTR("BuildVersion")); //CFShow(cfBuildVersion); + CFPropertyListRef cfCpuArchitecture = lib()->deviceCopyValue(device, + 0, + CFSTR("CPUArchitecture")); + //CFShow(cfCpuArchitecture); + if (cfCpuArchitecture) { + if (CFGetTypeID(cfCpuArchitecture) == CFStringGetTypeID()) { + res[cpuArchitectureKey] = QString::fromCFString( + reinterpret_cast(cfCpuArchitecture)); + } + CFRelease(cfCpuArchitecture); + } + //CFShow(cfBuildVersion); QString versionString; if (cfProductVersion) { if (CFGetTypeID(cfProductVersion) == CFStringGetTypeID())