私は同じ問題に直面していました。私のケースでは、私は最近Xcodeを8.2.1にアップデートしました。また、swift 3.0にも付属しています。 私はこのログを取得していました。
Ranvijay-Mac-mini:PerfectTemplate ranaranvijaysingh$ swift build
error: unable to invoke subcommand: /Library/Developer/CommandLineTools/usr/bin/swift-build (No such file or directory)
パスが正しくありませんでした。
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
パスを変更するには、次のコマンドを実行します。
export PATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin:$PATH
そして完了。
実行:swift build
プロジェクトで、このエラーが発生した場合は、再度実行してください。
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: Invalid platform path
また、SDKのパスも変更する必要があります。私の場合は
は、私は、あなたのSDKのパスが何であるかを知って、このコマンドを実行するには、パス
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/
MacOSX.sdk MacOSX10.12.sdk
で2 .sdkを持っていました。
xcrun --sdk macosx --show-sdk-path
私の場合は私が持っています。
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
変更するには、このコマンドを実行します。
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
とNOW DONE。 swift build
を今すぐ試してみてください。
これは正解です。うまくいけば、これまでのところ人々がスクロールします。ありがとうございました! – vicTROLLA
答えとしてさらに確かめるために:https://lists.swift.org/pipermail/swift-build-dev/Week-of-Mon-20160321/000362.html – BM5k
時には、その 'xcrun --find swift'コマンド「迅速なビルド」の前に入力する必要もあります –