The Swift standard library from the toolchain cannot be used on devices

Get the following error when using the official Swift 5.2.4 toolchain in Xcode 11.6.

Unsupported Configuration

The Swift standard library from the toolchain cannot be used on devices.

Select a macOS or simulator run destination instead, or use a different toolchain that only provides the compiler

Works fine when compiled for the simulator. Any clues for solving this problem?

2 Likes

I'm getting the exact same dialog.
I'm using swift-5.5.1-RELEASE-osx for Xcode on Xcode 13.3. I can build, but not run for a device target.
Setting ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES flag to false doesn't help either.
Any help?

1 Like

Sorry, I didn't understand the forum software and deleted my first reply.

To the best of my knowledge, Xcode doesn't allow any custom toolchain for device builds (even those that will never be submitted to the App Store). This is true even if you statically link the libraries into your binary. If you need Swift 5.5, you'll need to redownload Xcode 13.2.1.