Only Command Line Tools installed, xctest executable not found

Hey,

I created a Swift executable package using swift package init --type executable. When running swift build or swift run, it tries to find xctest but fails.

swift build
# error: terminated(72): xcrun --sdk macosx --find xctest output:
#     xcrun: error: unable to find utility "xctest", not a developer tool or in PATH

I have just (re-)installed a fresh Command Line Tools version. I don't want to (and don't have the disk space available) to download XCode. xcode-select --reset does not help either.

  • macOS 10.15.3
  • xcode-select version 2373
  • Swift version 5.1.3 (swiftlang-1100.0.282.1 clang-1100.0.33.15)

How can I build the package, without swift build looking for xctest?

Thanks for your help.

1 Like

I've run into the same issue. Did you ever find a solution without using Xcode?

i haven‘t found a solution so far, but i also haven‘t looked into it further.

sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
this make sense to me

This requires that you have Xcode installed, which previous posters did not want to install.

1 Like

22 days seem to have passed since the last comment. Has anyone found a solution?

Same issue here. I was trying to play with Swift and ran into this problem.

I've tried installing the swift package via brew but it also lacks xctest binary. For now, even being able to skip building/running test (to produce executable binary) would be fine.

(there is GitHub - swiftwasm/swift-corelibs-xctest: The XCTest Project, A Swift core library for providing unit test support but it should be build with Xcode as it seems…)

Terms of Service

Privacy Policy

Cookie Policy