Manually Mount the Metal Toolchain When Xcode Cannot

My Xcode 26.2 still suffers from an inability to compile Metal shader files because it can’t find the Metal toolchain:

error: cannot execute tool ‘metal’ due to missing Metal Toolchain; use: xcodebuild -downloadComponent MetalToolchain

That command also doesn’t do anything to fix this for me.

But I did have success mounting the .dmg file with the toolchain manually.

Since the version and filenames change with each toolchain update, the following wildcard filename should cover you unless you have multiple versions installed; in that case, tab to expand and select one of the suggestions:

$ open /System/Library/AssetsV2/com_apple_MobileAsset_MetalToolchain/*.asset/AssetData/Restore/*.dmg

Create an alias for this to make it easy to mount from the Terminal, or have launchd do this after reboot and you’re set. It’s a dirty hack but it’s better than not compiling.

Missing Permissions Problem

I still need to figure out why this is a problem on my machine at all.

Before mounting it, xcodebuild would error out with missing access privileges:

$ xcodebuild -showComponent metalToolchain
2026-01-07 06:44:37.977 xcodebuild[46295:2298282]  IDEDownloadableMetalToolchainCoordinator: Failed to remount the Metal Toolchain: The file “com.apple.MobileAsset.MetalToolchain-v17.3.48.0.ewArbw” couldn’t be opened because you don’t have permission to view it.
2026-01-07 06:44:38.167 xcodebuild[46295:2298293]  IDEDownloadableMetalToolchainCoordinator: Failed to remount the Metal Toolchain: The file “com.apple.MobileAsset.MetalToolchain-v17.3.48.0.ewArbw” couldn’t be opened because you don’t have permission to view it.
2026-01-07 06:44:38.174 xcodebuild[46295:2298293]  IDEDownloadableMetalToolchainCoordinator: Failed to remount the Metal Toolchain: The file “com.apple.MobileAsset.MetalToolchain-v17.3.48.0.ewArbw” couldn’t be opened because you don’t have permission to view it.
Asset Path: /System/Library/AssetsV2/com_apple_MobileAsset_MetalToolchain/0bc538ab0cfa107625f77ad7bcfa566abe43e917.asset/AssetData
Build Version: 17C48
Status: installed
Toolchain Search Path: /private/var/run/com.apple.security.cryptexd/mnt/com.apple.MobileAsset.MetalToolchain-v17.3.48.0.ewArbw

After mounting it manually, I get this output:

$ xcodebuild -showComponent metalToolchain
Asset Path: /System/Library/AssetsV2/com_apple_MobileAsset_MetalToolchain/0bc538ab0cfa107625f77ad7bcfa566abe43e917.asset/AssetData
Build Version: 17C48
Status: installed
Toolchain Identifier: com.apple.dt.toolchain.Metal.32023
Toolchain Search Path: /Volumes/MetalToolchainCryptex

I don’t know how Xcode would normally try to mount this – I would guess using a priviliged helper? Whatever it tries to do, it fails.