Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Local testing on Mac not working (fix inside) #760

Open
kempsu opened this issue Jul 9, 2024 · 2 comments
Open

Local testing on Mac not working (fix inside) #760

kempsu opened this issue Jul 9, 2024 · 2 comments

Comments

@kempsu
Copy link

kempsu commented Jul 9, 2024

A common error is occuring because of incorrect SDK paths.

$ swift test
warning: could not determine XCTest paths: terminated(1): /usr/bin/xcrun --sdk macosx --show-sdk-platform-path output:
    xcrun: error: unable to lookup item 'PlatformPath' from command line tools installation
    xcrun: error: unable to lookup item 'PlatformPath' in SDK '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk'

error: XCTest not available

You can fix this error as followed:

$ xcrun --show-sdk-path --sdk macosx

You might get this result:

/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk

Now change the default SDK location by invoking the following command:

$ sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer

If that also does not work, please take a look inside the regular SDK path:

$ ls -lat /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/

Normally you should see the SDKs inside this directory. If not, you'll need to download the SDKs first.

@meatball133
Copy link
Member

I am not really sure what this issue has to do with this repo? Feels like a swift issue or xcode issue. I use Swift frequently on Linux which have worst support than mac and xctest is builtin into the swift package and also which swift version do you use?

@kempsu
Copy link
Author

kempsu commented Jul 9, 2024

I wanted to raise the potential issue with the docs of the Swift track, sorry if that wasn't clear. The issue might have occured on my system because I also installed the XCode 16 Beta in parallel.

I am using the following swift version:
swift-driver version: 1.90.11.1 Apple Swift version 5.10 (swiftlang-5.10.0.13 clang-1500.3.9.4)
Target: arm64-apple-macosx14.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants