Xcode fails to download iOS Simulator runtime with “Failed fetching catalog for assetType (MobileAsset)”

Summary

The issue described is a transient infrastructure failure on Apple’s side, not a misconfiguration of the developer’s environment. The specific error Error Domain=com.apple.MobileAssetError.Download Code=47 indicates that the local Xcode tooling (xcodebuild or Xcode UI) successfully attempted to contact Apple’s MobileAsset catalog server but received a generic networking error or an unreachable response. While the user verified network settings (no proxy/VPN), the failure to download specific iOS Simulator runtimes (18.4/18.6) while others remain accessible points to a stale or corrupted CDN cache edge or a temporary outage of the specific asset URL required for those runtimes.

Root Cause

The root cause is a breakdown in the communication between the local Xcode instance and Apple’s content delivery network (CDN) for specific MobileAsset catalogs.

  • CDN/Edge Node Unavailability: The specific asset catalog URL for iOS 18.4/18.6 runtimes is unreachable or returns an invalid response from the Akamai/Apple CDN edge node serving your region.
  • Stale Local Catalog Cache: The operating system maintains a cache of available MobileAssets. If this cache becomes stale or corrupted, subsequent download requests may fail even if the network is functional.
  • softwareupdated Daemon State: The background service responsible for handling these downloads (softwareupdated) may be in a hung state or holding onto a bad connection token.

Why This Happens in Real Systems

In large-scale distributed systems like Apple’s developer infrastructure, eventual consistency is the standard.

  • Geographic Replication: Asset catalogs are replicated globally. It is common for a specific region’s mirror to be out of sync or temporarily unreachable while others are healthy.
  • Asynchronous Propagation: When Apple releases a new Simulator runtime, the metadata must propagate to all CDN edges. During this window (which can last hours), xcodebuild -downloadPlatform will fail with generic networking errors because the requested asset URI does not yet exist on the edge node your request is routed to.
  • No Graceful Fallback: The xcodebuild CLI tool lacks a robust retry mechanism or a multi-mirror fallback strategy, resulting in an immediate hard failure (Error 47) rather than a retry.

Real-World Impact

  • Blocked CI/CD Pipelines: Automated builds that rely on specific iOS versions (e.g., building for iOS 18.6 specifically) will fail to provision the environment, halting deployments.
  • Developer Velocity Loss: Developers are forced to downgrade their build targets to older, already-installed runtimes (e.g., 18.2), delaying testing against the latest OS features.
  • Inconsistent Environments: Team members on different networks (or using VPNs to tunnel through bad ISP routes) may experience different results, leading to “works on my machine” scenarios.

Example or Code

This issue is infrastructure-related, so there is no buggy application code. However, the following commands are used to diagnose and recover from the state.

1. Diagnosis (Check for stale cache):

# Check what assets are currently "known" to the system
xcodebuild -showsdks

2. The Failing Operation:

# The command that triggers the MobileAsset error
xcodebuild -downloadPlatform iOS

3. The Workaround (Manual Download):
If the CLI fails, the “Senior Engineer” workaround is to bypass the softwareupdated daemon and download the DMG directly from Apple’s developer portal, then mount and install it manually.

# Example of manually installing a simulator runtime DMG if downloaded manually
# (Note: You must obtain the DMG from developer.apple.com/download/more/)
hdiutil attach "iOS_18.6_Simulator_Runtime.dmg"
sudo xcrun simctl runtime add "/Volumes/iOS 18.6 Simulator/iOS_18.6_Simulator_Runtime.dmg"
hdiutil detach "/Volumes/iOS 18.6 Simulator"

How Senior Engineers Fix It

Senior engineers distinguish between environment misconfiguration and infrastructure flakiness. Since the user confirmed no proxies and tried a different network, the focus shifts to state clearing and bypassing the standard tool.

  1. Nuke the Asset Cache: We don’t just restart; we clear the specific state causing the lock.
    # Stop the update daemon
    sudo softwareupdate --background off
    # Clear the specific MobileAsset cache directory
    sudo rm -rf /Library/Developer/CoreSimulator/Caches/com.apple.mobileasset
    # Restart the daemon
    sudo softwareupdate --background on
  2. Force Catalog Refresh: Use xcodebuild -firstLaunch or reinstall Xcode components to force a fresh manifest fetch.
  3. Bypass the CLI: If softwareupdated is buggy (a known issue in macOS 15.x), the fix is to manually download the DMG from the Apple Developer Downloads page. This isolates the download from the fragile Apple MobileAsset daemon.
  4. Verify Connectivity via nslookup: Senior engineers verify if the specific asset domain (updates-http.cdn-apple.com) is resolvable and reachable, ruling out DNS poisoning by the ISP.

Why Juniors Miss It

Junior engineers often misdiagnose this error because the error message is misleadingly generic.

  • Misinterpreting “Network Error”: They assume “networking error” means their network is broken. They waste hours changing Wi-Fi, resetting routers, or configuring proxies, failing to realize the connection is successful but the server response is empty or 404.
  • Trusting the Tool Output: They believe that because xcodebuild fails, their environment is broken. They lack the experience to recognize that Apple’s developer servers are notoriously unreliable and that “Error 47” is often Apple-speak for “Please try again later.”
  • Fear of Manual Intervention: Juniors hesitate to manually manipulate /Library/ directories or bypass the GUI/Xcode CLI tools, preferring to wait for a fix rather than manually downloading and installing the runtime DMG.