exercism / exercism/swift

Local testing on Mac not working (fix inside)

Open
#760 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
Swift
Stars
122
Forks
165
PR merge metrics
No merged PRs in 30d

Description

A common error is occuring because of incorrect SDK paths.

```bash
$ 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:

```bash
$ xcrun --show-sdk-path --sdk macosx
```

You might get this result:

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

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

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

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

```bash
$ 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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.