<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div><div style="direction: inherit;">If you already have two versions of Xcode installed in the /Application then I think using <b>xcode-select</b> tool would be easier.</div><div style="direction: inherit;"><br></div><div style="direction: inherit;">type <b>sudo xcode-select -s /Application/Xcode.app</b> will get you Swift 2.3 and all the environment of Xcode 7</div><div style="direction: inherit;"><br></div><div style="direction: inherit;"><b>sudo xcode-select -s /Application/Xcode-Beta.app </b>will quickly switch everything to Xcode 8</div><div style="direction: inherit;"><br></div><div style="direction: inherit;"><br></div><div style="direction: inherit;">Sam</div></div><div><br>On Aug 11, 2016, at 2:58 PM, Zhao Xin via swift-users &lt;<a href="mailto:swift-users@swift.org">swift-users@swift.org</a>&gt; wrote:<br><br></div><blockquote type="cite"><div><div dir="ltr"><div class="gmail_default" style="font-family:georgia,serif">Thank you Keith. You helped me a lot. I finally got it work.</div><div class="gmail_default" style="font-family:georgia,serif"><br></div><div class="gmail_default" style="font-family:georgia,serif">As realm use "xcrun swift" to get swift version. I did that by '<span style="font-family:Menlo;font-size:11px">export TOOLCHAINS=com.apple.dt.toolchain.Swift_2_3'.</span></div><div class="gmail_default" style="font-family:georgia,serif"><span style="font-family:Menlo;font-size:11px"><br></span></div><div class="gmail_default" style="font-family:georgia,serif">I also think the document in&nbsp;<a href="https://swift.org/download/#using-downloads">https://swift.org/download/#using-downloads</a>&nbsp;should change&nbsp;</div><div class="gmail_default" style="font-family:georgia,serif"><br></div><div class="gmail_default"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><font face="georgia, serif">$ export PATH=/Library/Developer/Toolchains/swift-latest.xctoolchain/usr/bin:"${PATH}"</font></blockquote><div><br></div><div>to export &nbsp;TOOLCHAINS as well.</div><div><br></div><div>Zhaoxin</div><div style="font-family:georgia,serif"><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Aug 11, 2016 at 2:56 PM, Keith Smiley <span dir="ltr">&lt;<a href="mailto:k@keith.so" target="_blank">k@keith.so</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">You can accomplish this with the `--toolchain` `xcrun` argument. It took a few<br>
tries but it seems as though this command works:<br>
<br>
```<br>
xcrun --toolchain "com.apple.dt.toolchain.Swift_<wbr>2_3" swiftc -v<br>
```<br>
<br>
I got this identifier from:<br>
<br>
/Applications/Xcode-beta.app/<wbr>Contents/Developer/Toolchains/<wbr>Swift_2.3.xctoolchain/<wbr>ToolchainInfo.plist<br>
<br>
--<br>
Keith Smiley<br>
<div><div class="h5"><br>
On 08/11, Zhao Xin via swift-users wrote:<br>
&gt; There are two toolchains under Xcode-beta.app/Contents/<br>
&gt; Developer/Toolchains/.<br>
&gt;<br>
&gt; &gt; Swift_2.3.xctoolchain/<br>
&gt; &gt; XcodeDefault.xctoolchain/<br>
&gt;<br>
&gt;<br>
&gt; So in a terminal. input<br>
&gt;<br>
&gt; &gt; export PATH=/Applications/Xcode-beta.<wbr>app/Contents/Developer/<br>
&gt; &gt; Toolchains/Swift_2.3.<wbr>xctoolchain/usr/bin:"${PATH}"<br>
&gt;<br>
&gt;<br>
&gt; After I did that, when I input swift, it would be 2.3, but when I type<br>
&gt; xcrun swift, it was still 3.0 or 2.2.<br>
&gt;<br>
&gt; Any idea?​<br>
&gt;<br>
&gt; Zhaoxin​<br>
&gt; ​<br>
&gt;<br>
&gt;<br>
&gt; On Thu, Aug 11, 2016 at 12:44 PM, Zhao Xin &lt;<a href="mailto:owenzx@gmail.com">owenzx@gmail.com</a>&gt; wrote:<br>
&gt;<br>
&gt; &gt; I try to change command line tool from Xcode 8.0(8S193k) to Xcode<br>
&gt; &gt; 7.3.1(7D1014), who lead me to swift 3.0 or swift 2.2. I need Swift 2.3 to<br>
&gt; &gt; build Realm Cocoa from its source.<br>
&gt; &gt;<br>
&gt; &gt; Any idea?<br>
&gt; &gt;<br>
&gt; &gt; Zhaoxin<br>
&gt; &gt;<br>
<br>
</div></div>&gt; ______________________________<wbr>_________________<br>
&gt; swift-users mailing list<br>
&gt; <a href="mailto:swift-users@swift.org">swift-users@swift.org</a><br>
&gt; <a href="https://lists.swift.org/mailman/listinfo/swift-users" rel="noreferrer" target="_blank">https://lists.swift.org/<wbr>mailman/listinfo/swift-users</a><br>
<br>
</blockquote></div><br></div>
</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>swift-users mailing list</span><br><span><a href="mailto:swift-users@swift.org">swift-users@swift.org</a></span><br><span><a href="https://lists.swift.org/mailman/listinfo/swift-users">https://lists.swift.org/mailman/listinfo/swift-users</a></span><br></div></blockquote></body></html>