Unable to connect Xcode 15 to iPhone (Error: developer disk image could not be mounted)

I am suddenly unable to connect to my iPhone (running iOS 17.0) in Xcode (either 15 or the last 15 beta). I get this error:

The developer disk image could not be mounted on this device.. Error mounting image: 0xe8000115 (kAMDMobileImageMounterDevicePropertyQueryFailure: Failed to query device property.)

I am able to see the disk image iOS_DDI.dmg in the Finder by opening /Users/cmonsour/Library/Developer/DeveloperDiskImages/

I have restarted both computer and iPhone, re-enabled Developer Mode, cleared Derived Data. I am not running a VPN. I am running the latest Xcode. I upgraded from Ventura to Sonoma with no improvement.

Any help appreciated. Unable to run anything from Xcode on my iPhone now, which is quite frustrating.

Details are as follows:

The developer disk image could not be mounted on this device.
Domain: com.apple.dt.CoreDeviceError
Code: 12040
Failure Reason: Error mounting image: 0xe8000115 (kAMDMobileImageMounterDevicePropertyQueryFailure: Failed to query device property.)
User Info: {
    DDIPath = "/Users/cmonsour/Library/Developer/DeveloperDiskImages/iOS_DDI.dmg";
    DVTErrorCreationDateKey = "2023-10-01 18:33:29 +0000";
    DeviceIdentifier = "A4E1792C-1396-4BAF-A1E1-73C19F9FB8A4";
    IDERunOperationFailingWorker = IDEInstallCoreDeviceWorker;
    NSURL = "file:///Users/cmonsour/Library/Developer/DeveloperDiskImages/iOS_DDI.dmg";
    Options =     {
        MountedBundlePath = "file:///private/var/tmp/CoreDevice_DDI_Staging_501/A4E1792C-1396-4BAF-A1E1-73C19F9FB8A4/";
        UseCredentials = 0;
    };
    "com.apple.dt.DVTCoreDevice.operationName" = enablePersonalizedDDI;
}
--
Error mounting image: 0xe8000115 (kAMDMobileImageMounterDevicePropertyQueryFailure: Failed to query device property.)
Domain: com.apple.mobiledevice
Code: -402652907
User Info: {
    FunctionName = AMDeviceRemoteMountPersonalizedBundle;
    LineNumber = 2108;
}
--
Failed to initialize remote device attributes: 0xe8000115 (kAMDMobileImageMounterDevicePropertyQueryFailure: Failed to query device property.)
Domain: com.apple.mobiledevice
Code: -402652907
User Info: {
    FunctionName = "-[PersonalizedImage mountImage:]";
    LineNumber = 1772;
}
--
Failed to retrieve personalization identifiers: 0xe8000115 (kAMDMobileImageMounterDevicePropertyQueryFailure: Failed to query device property.)
Domain: com.apple.mobiledevice
Code: -402652907
User Info: {
    FunctionName = "-[PersonalizedImage initializeRemoteDeviceAttributes:]";
    LineNumber = 1367;
}
--

Event Metadata: com.apple.dt.IDERunOperationWorkerFinished : {
    "device_isCoreDevice" = 1;
    "device_model" = "iPhone14,5";
    "device_osBuild" = "17.1 (21B5045h)";
    "device_platform" = "com.apple.platform.iphoneos";
    "dvt_coredevice_version" = "348.1";
    "dvt_mobiledevice_version" = "1643.2.4";
    "launchSession_schemeCommand" = Run;
    "launchSession_state" = 1;
    "launchSession_targetArch" = arm64;
    "operation_duration_ms" = 173097;
    "operation_errorCode" = "-402652907";
    "operation_errorDomain" = "com.apple.dt.CoreDeviceError.12040.com.apple.mobiledevice";
    "operation_errorWorker" = IDEInstallCoreDeviceWorker;
    "operation_name" = IDERunOperationWorkerGroup;
    "param_debugger_attachToExtensions" = 0;
    "param_debugger_attachToXPC" = 1;
    "param_debugger_type" = 3;
    "param_destination_isProxy" = 0;
    "param_destination_platform" = "com.apple.platform.iphoneos";
    "param_diag_MainThreadChecker_stopOnIssue" = 0;
    "param_diag_MallocStackLogging_enableDuringAttach" = 0;
    "param_diag_MallocStackLogging_enableForXPC" = 1;
    "param_diag_allowLocationSimulation" = 1;
    "param_diag_checker_tpc_enable" = 1;
    "param_diag_gpu_frameCapture_enable" = 0;
    "param_diag_gpu_shaderValidation_enable" = 0;
    "param_diag_gpu_validation_enable" = 0;
    "param_diag_memoryGraphOnResourceException" = 0;
    "param_diag_queueDebugging_enable" = 1;
    "param_diag_runtimeProfile_generate" = 0;
    "param_diag_sanitizer_asan_enable" = 0;
    "param_diag_sanitizer_tsan_enable" = 0;
    "param_diag_sanitizer_tsan_stopOnIssue" = 0;
    "param_diag_sanitizer_ubsan_stopOnIssue" = 0;
    "param_diag_showNonLocalizedStrings" = 0;
    "param_diag_viewDebugging_enabled" = 1;
    "param_diag_viewDebugging_insertDylibOnLaunch" = 1;
    "param_install_style" = 0;
    "param_launcher_UID" = 2;
    "param_launcher_allowDeviceSensorReplayData" = 0;
    "param_launcher_kind" = 0;
    "param_launcher_style" = 99;
    "param_launcher_substyle" = 8192;
    "param_runnable_appExtensionHostRunMode" = 0;
    "param_runnable_productType" = "com.apple.product-type.application";
    "param_structuredConsoleMode" = 1;
    "param_testing_launchedForTesting" = 0;
    "param_testing_suppressSimulatorApp" = 0;
    "param_testing_usingCLI" = 0;
    "sdk_canonicalName" = "iphoneos17.0";
    "sdk_osVersion" = "17.0";
    "sdk_variant" = iphoneos;
}
--
System Information

macOS Version 14.0 (Build 23A344)
Xcode 15.0 (22265) (Build 15A240d)
Timestamp: 2023-10-01T14:33:29-04:00
Answered by cmonsour in 766773022

Update: As a workaround, I was able to get Xcode working with my iPhone again by Eras[ing] All Content and Settings and restoring my iPhone from iCloud. Not ideal, but it worked.

quit Xcode delete ~/Library/Developer/DeveloperDiskImages/ Turn off developer mode on iphone restart iphone

then start it all back up and it worked.

I tried the above - and it still isn't working for me - just switching from a 2023 iPad Pro gen 9 to a 2024 iPad Pro gen 10

I just rebooted the iPhone and then it worked again 🥳

If it helps anyone else, I had two instances of XCode installed and was running a different version of command line tools. Going to Settings -> Locations and setting command line tools to the correct version fixed it for me.

None of these solutions helped me (though I didn't try erasing my phone).

I know this post is about a year old, but if you're encountering this same issue today with Xcode 16 and the iPhone 16, the following post from an Apple engineer contains a solution:

https://forums.developer.apple.com/forums/thread/764196?answerId=804884022#804884022

Unable to connect Xcode 15 to iPhone (Error: developer disk image could not be mounted)
 
 
Q