MacOSX Sonoma 14.7 + XCode 16.0 + iOS 17.6.1:

I am trying to install an app from a XCode project onto a iOS 17.6.1 device. The Macbook is a MacOSX Sonoma 14.7, Apple M2 Pro. I'm running XCode 16.0. I receive a series of alerts before receiving the final message.

I tried to delete everything in this folder:

rm ~/Library/Caches/com.apple.dt.Xcode/Downloads/*

I reviewed the XCode components currently installed:

I downloaded more runtime simulators from this link. I then followed the instructions provided in this link. For example:

xcrun simctl runtime add "~/Downloads/iOS_17.4_Simulator_Runtime.dmg"
xcrun simctl runtime add "~/Downloads/iOS_17.5_Simulator_Runtime.dmg"

I'm still getting a message beside the device I want to install my app:

The Developer Disk Image Could Not Be Staged On The Host

I need help. I don't know what else to do. I don't see any matching simulators available for 17.6.1 and 17.7. Does anyone have any ideas?

Answered by DTS Engineer in 806730022

One other easy test you can do is to create a brand new macOS user account, and see what happens when you try to build and run to your device from that new account. That would provide information about an issue pertaining to your setup at the user account level, or at the broader macOS system level. And if a new macOS user account is able to connect to the device, that then provides you a workaround while we investigate your bug report so that your development efforts are not blocked.

—Ed Ford,  DTS Engineer

Our engineering teams need to investigate this issue, as resolution may involve changes to Apple's software. I'd greatly appreciate it if you could open a bug report, include a sysdiagnose, and post the FB number here once you do. Bug Reporting: How and Why? has tips on creating your bug report.

Here is the FB number: FB15289146

Thank you!

It'd be helpful if you could attach the output of devicectl diagnose to your bug report while your Mac is in this state to help us address the underlying issue.

However, as we investigate to ultimately fix the root issue, that will take time, so let's see if we can find you a workaround so that you can continue to develop. This comes down to there being something unusual about your Mac's overall state that's preventing Xcode from making the connection to the device. It's unlikely a clean macOS install would exhibit this issue, as a reference point.

First, please get the output to the following commands and share them here in case they shed some light on the situation:

xcrun devicectl list preferredDDI
xcrun devicectl device info ddiServices --device <Device Identifier>

Next, do a simple reboot of your Mac, since your notes don't list if you tried that.

If rebooting doesn't help, can you check the permissions on your temporary folder are correct? You can run this command:

sudo chmod 1777 /private/var/tmp /private/tmp

[Note: I edited the exact command and permission type to use after posting the response, so the responses later in this thread include the results of the previous variation I posted. This edit is the correct command.]

I don't expect that will help here, but it's a simple thing to try that does address some form of these errors, though I also have suspicions that your circumstances may not match those cases.

— Ed Ford,  DTS Engineer

Thanks for your reply...

Here is the information you have requested:

Request

xcrun devicectl list preferredDDI

Response

Host CoreDevice version: 397.21
The DDI used for the iOS platform:
• hostDDI: file:///Library/Developer/DeveloperDiskImages/iOS_DDI.dmg
▿ ddiMetadata:
    • buildUpdate: 16A242d
    • contentIsCompatible: true
    • coreDeviceVersionChecksIncludeDevelopmentRevision: true
    • developmentRevision: 0
    • enforcingCoreDeviceVersionChecks: true
    • platform: iOS
    ▿ projectMetadata:
        • Citrine-94
        • CoreDevice-397.21
        • DTDeveloperDiskImageSupport-14.0.0
        • DTOCMock-23002
        • GPUToolsDevice_DDI-300.21
        • JetsamProperties-2205
        • LiveExecutionResultsLogger-20002
        • Mercury-54
        • XCTest-23196
    • isUsable: true
    • variant: external
The DDI used for the tvOS platform:
• hostDDI: file:///Library/Developer/DeveloperDiskImages/tvOS_DDI.dmg
▿ ddiMetadata:
    • buildUpdate: 16A242d
    • contentIsCompatible: true
    • coreDeviceVersionChecksIncludeDevelopmentRevision: true
    • developmentRevision: 0
    • enforcingCoreDeviceVersionChecks: true
    • platform: tvOS
    ▿ projectMetadata:
        • Citrine-94
        • CoreDevice-397.21
        • DTDeveloperDiskImageSupport-14.0.0
        • DTOCMock-23002
        • GPUToolsDevice_DDI-300.21
        • JetsamProperties-2205
        • LiveExecutionResultsLogger-20002
        • Mercury-54
        • XCTest-23196
    • isUsable: true
    • variant: external
The DDI used for the watchOS platform:
• hostDDI: file:///Library/Developer/DeveloperDiskImages/watchOS_DDI.dmg
▿ ddiMetadata:
    • buildUpdate: 16A242d
    • contentIsCompatible: true
    • coreDeviceVersionChecksIncludeDevelopmentRevision: true
    • developmentRevision: 0
    • enforcingCoreDeviceVersionChecks: true
    • platform: watchOS
    ▿ projectMetadata:
        • Citrine-94
        • CoreDevice-397.21
        • DTDeveloperDiskImageSupport-14.0.0
        • DTOCMock-23002
        • GPUToolsDevice_DDI-300.21
        • JetsamProperties-2205
        • LiveExecutionResultsLogger-20002
        • Mercury-54
        • XCTest-23196
    • isUsable: true
    • variant: external
The DDI used for the visionOS platform:
• hostDDI: file:///Library/Developer/DeveloperDiskImages/xrOS_DDI.dmg
▿ ddiMetadata:
    • buildUpdate: 16A242d
    • contentIsCompatible: true
    • coreDeviceVersionChecksIncludeDevelopmentRevision: true
    • developmentRevision: 0
    • enforcingCoreDeviceVersionChecks: true
    • platform: xrOS
    ▿ projectMetadata:
        • Citrine-94
        • CoreDevice-397.21
        • DTDeveloperDiskImageSupport-14.0.0
        • DTOCMock-23002
        • GPUToolsDevice_DDI-300.21
        • JetsamProperties-2205
        • LiveExecutionResultsLogger-20002
        • Mercury-54
        • XCTest-23196
    • isUsable: true
    • variant: external

Other Request

xcrun devicectl device info ddiServices --device <My UDID>

Other Response

10:18:53  Acquired tunnel connection to device.
10:18:53  Enabling developer disk image services.
ERROR: The developer disk image could not be staged on the host. (com.apple.dt.CoreDeviceError error 12045 (0x2F0D))
       NSURL = file:///Library/Developer/DeveloperDiskImages/iOS_DDI.dmg
       DeviceIdentifier = FC91CD07-395E-4AD4-826B-FECB15FCB740
--------------------------------------------------------------------------------
ERROR:     Couldn’t communicate with a helper application. (NSCocoaErrorDomain error 4099 (0x1003))
           NSDebugDescription = The connection to service created from an endpoint was invalidated: failed at lookup with error 9 - Bad file descriptor.

As far as the sudo chmod 0777 /private/var/tmp, the root user owns that folder.

I've also added additional information to the ticket I submitted.

Thanks for all that you are doing for me. I'm humbled and am grateful.

Accepted Answer

One other easy test you can do is to create a brand new macOS user account, and see what happens when you try to build and run to your device from that new account. That would provide information about an issue pertaining to your setup at the user account level, or at the broader macOS system level. And if a new macOS user account is able to connect to the device, that then provides you a workaround while we investigate your bug report so that your development efforts are not blocked.

—Ed Ford,  DTS Engineer

The Developer Disk Image Could Not Be Staged On The Host

This error often indicates a problem with permissions of your temp directory, which can be solved as mentioned above, but in this case, the sub error indicates it's something different:

The connection to service created from an endpoint was invalidated: failed at lookup with error 9 - Bad file descriptor.

Can you please file a bug report via https://bugreport.apple.com with a sysdiagnose from the macOS host experiencing the issue? Please indicate the FB Number here and also include the URL to this post in the report, so we can connect the two.

I don't see any matching simulators available for 17.6.1 and 17.7.

That is expected. Simulator runtimes were not release for those versions.

—Jeremy Sequoia -  Developer Tools / Devices & Simulators

@inquiringuser202

The justification was that there was security software on my machine that interferes with this process.

This is an interesting situation. Do you happen to have additional insight on this particular situation?

Those are interesting details. I see that you filed FB15289146, so could you leave a comment on that report with the security software that you have and you believe is installed (and then leave a note here once that's done)? I think I can tell which commercial product you are using from the information you already provided in that report, but it would still be good to have confirmation from you since you know your own system best.

As to additional insights, we need to further our investigation, and that detail above could be a significant help. Anecdotally, I can say that I've seen security software cause many unusual problems over many years that are otherwise difficult to explain or reproduce, and the specifics tend to be unique in each case. So, I'm not saying that security software is the source of the problem here because we need to investigate that possibility, but it's also not out of the realm of possibilities.

— Ed Ford,  DTS Engineer

MacOSX Sonoma 14.7 + XCode 16.0 + iOS 17.6.1:
 
 
Q