您当前的位置: 首页 >  swift

如何找出Xcode中不同版本Swift的路径

发布时间:2016-08-10 07:22:24 ,浏览量:0

我们知道Xcode中可能包含不知一个Swift的版本,那么我们如何找到它们对应的路径呢?

熟悉unix shell命令的童鞋都知道有一个find指令,在我们已知Xcode路径时,我们可以在其中找到Swift在哪里:

find /Applications/Xcode.app -name swift -a -type f

以上命令中的-a选项表示的是and逻辑,你也可以写全称为-and.所以你必须同时符合name为swift,同时type为一般文件这两个条件才可以哦.

其他type的参数有:

-type t
             True if the file is of the specified type.  Possible file types are as follows:

             b       block special
             c character special
             d directory f       regular file l       symbolic link
             p       FIFO
             s socket

在本猫的air上运行以上指令结果如下:

/Applications/Xcode-beta.app/Contents/Developer/Toolchains/Swift_2.3.xctoolchain/usr/bin/swift
/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift

第一个swift版本显然是2.3,我们看一下后面Swift的版本:

/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -version Apple Swift version 3.0 (swiftlang-800.0.34.6 clang-800.0.33)
Target: x86_64-apple-macosx10.9

不出意外是Swift 3.0哦,我的Xcode是8.0beta4

关注
打赏
1688896170
查看更多评论

暂无认证

  • 0浏览

    0关注

    105964博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文
立即登录/注册

微信扫码登录

0.9849s