v3 的 swift/swiftc 二进制文件在哪里? [英] Where are the swift/swiftc binaries for v3?

查看:24
本文介绍了v3 的 swift/swiftc 二进制文件在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚下载了 Xcode 8 beta,并且正在努力找出 swiftswiftc 二进制文件的隐藏位置.

I've just downloaded the Xcode 8 beta, and am struggling to figure out where the swift and swiftc binaries are hidden.

Swift 网站表示该工具链应该在 /库/开发人员/工具链,并且可以导出以在命令行上使用:

The Swift website says that the toolchain should be available at /Library/Developer/Toolchains and that it can be exported for use on command line with:

$ export PATH=/Library/Developer/Toolchains/swift-latest.xctoolchain/usr/bin:"${PATH}"

但这条路对我来说似乎不存在.

But that path doesn't seem to exist for me.

我可以看到 Xcode-beta.app/Contents/Developer/Toolchains/Swift_2.3.xctoolchain,但那是针对 2.3 而不是 3.

I can see Xcode-beta.app/Contents/Developer/Toolchains/Swift_2.3.xctoolchain, but that's for 2.3 rather than 3.

有什么想法吗?

推荐答案

感谢 Marc B 的建议:

⇒  find / -name swift -type f
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift
/Users/myusername/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/Swift_2.3.xctoolchain/usr/bin/swift
/Users/myusername/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift
/usr/bin/swift

对我来说是:

⇒  /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift --version
Apple Swift version 2.2 (swiftlang-703.0.18.8 clang-703.0.31)
Target: x86_64-apple-macosx10.9

⇒  /Users/myusername/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/Swift_2.3.xctoolchain/usr/bin/swift --version
Apple Swift version 2.3 (swiftlang-800.10.6 clang-800.0.24.1)
Target: x86_64-apple-macosx10.9

⇒  /Users/myusername/Desktop/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift --version
Apple Swift version 3.0 (swiftlang-800.0.30 clang-800.0.24)
Target: x86_64-apple-macosx10.9

⇒  /usr/bin/swift --version
Apple Swift version 2.2 (swiftlang-703.0.18.8 clang-703.0.31)
Target: x86_64-apple-macosx10.9

要将 v3 设置为您的主要"swift,您可以执行以下操作(确保使用正确的 Xcode 8 应用程序路径):

To set v3 as your 'main' swift, you can do the following (make sure to use the right path to your Xcode 8 application):

⇒  sudo xcode-select -s /Applications/Xcode-beta.app/Contents/Developer

⇒  xcrun --find swift
/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift

⇒  swift --version
Apple Swift version 3.0 (swiftlang-800.0.30 clang-800.0.24)
Target: x86_64-apple-macosx10.9

这篇关于v3 的 swift/swiftc 二进制文件在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆