मुझे एक ही समस्या का सामना करना पड़ रहा था और मेरे मामले में, मैंने हाल ही में अपना एक्सकोड 8.2.1 पर अपडेट किया और स्विफ्ट 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
तो आपको एसडीके पथ भी बदलना होगा।
मेरे मामले में, मैं पथ
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/
MacOSX.sdk MacOSX10.12.sdk
में दो .sdk था अपने एसडीके मार्ग है क्या पता करने के लिए, इस आदेश को चलाते हैं।
xcrun --sdk macosx --show-sdk-path
मेरा मामला मुझे यह मिला।
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
इसे बदलने के लिए यह आदेश चलाएं।
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
और अब किया गया। अब swift build
चलाने का प्रयास करें।
यह सही उत्तर है। उम्मीद है कि लोग अब तक नीचे स्क्रॉल करें। धन्यवाद! – vicTROLLA
इसे उत्तर के रूप में आगे बढ़ाने के लिए: https://lists.swift.org/pipermail/swift-build-dev/Week-of-Mon-20160321/000362.html – BM5k
कभी-कभी इसकी 'xcrun --find swift' कमांड' 'स्विफ्ट बिल्ड' –