Xcode 10.2 (beta) & Command Line Tools

Has anyone figured out how to build and run Swift command line tools in the Xcode 10.2 (beta)?

Even with the simplest application, I receive the following error when I run the application:

dyld: Library not loaded: @rpath/libswiftCore.dylib

This issue is described in the Swift 5 release notes:

  • Swift command line projects crash on launch with “dyld: Library not loaded” errors. (46824656) Workaround: Add a user-defined build setting SWIFT_FORCE_STATIC_LINK_STDLIB=YES .
7 Likes

Thank you Boris. I read the release notes, but it seems this one escaped me.

According to the Swift 5 Release Notes for Xcode 10.2 Beta 3 you can now download the “Swift 5 Runtime Support for Command Line Tools” for macOS 10.14.3 and earlier.

That package installs various Swift runtime libraries in /usr/lib/swift, so that dynamic linking works again.

3 Likes