Skip to content

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

Description

@kempsu

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions