<div dir="ltr"><div class="gmail_default" style="font-family:georgia,serif">Thanks, Sam. However, as in Xcode-Beta.app, there are two version of Swift, 3.0 and 2.3, and 3.0 is chosen if I do your method. </div><div class="gmail_default" style="font-family:georgia,serif"><br></div><div class="gmail_default" style="font-family:georgia,serif">Zhaoxin</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Aug 18, 2016 at 10:11 AM, Sikhapol Saijit <span dir="ltr"><<a href="mailto:sikhapol@gmail.com" target="_blank">sikhapol@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div 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><div class="h5"><div><br>On Aug 11, 2016, at 2:58 PM, Zhao Xin via swift-users <<a href="mailto:swift-users@swift.org" target="_blank">swift-users@swift.org</a>> 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.<wbr>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 <a href="https://swift.org/download/#using-downloads" target="_blank">https://swift.org/download/<wbr>#using-downloads</a> should change </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/<wbr>Toolchains/swift-latest.<wbr>xctoolchain/usr/bin:"${PATH}"</font></blockquote><div><br></div><div>to export 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"><<a href="mailto:k@keith.so" target="_blank">k@keith.so</a>></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/C<wbr>ontents/Developer/Toolchains/S<wbr>wift_2.3.xctoolchain/Toolchain<wbr>Info.plist<br>
<br>
--<br>
Keith Smiley<br>
<div><div><br>
On 08/11, Zhao Xin via swift-users wrote:<br>
> There are two toolchains under Xcode-beta.app/Contents/<br>
> Developer/Toolchains/.<br>
><br>
> > Swift_2.3.xctoolchain/<br>
> > XcodeDefault.xctoolchain/<br>
><br>
><br>
> So in a terminal. input<br>
><br>
> > export PATH=/Applications/Xcode-beta.<wbr>app/Contents/Developer/<br>
> > Toolchains/Swift_2.3.xctoolcha<wbr>in/usr/bin:"${PATH}"<br>
><br>
><br>
> After I did that, when I input swift, it would be 2.3, but when I type<br>
> xcrun swift, it was still 3.0 or 2.2.<br>
><br>
> Any idea?<br>
><br>
> Zhaoxin<br>
> <br>
><br>
><br>
> On Thu, Aug 11, 2016 at 12:44 PM, Zhao Xin <<a href="mailto:owenzx@gmail.com" target="_blank">owenzx@gmail.com</a>> wrote:<br>
><br>
> > I try to change command line tool from Xcode 8.0(8S193k) to Xcode<br>
> > 7.3.1(7D1014), who lead me to swift 3.0 or swift 2.2. I need Swift 2.3 to<br>
> > build Realm Cocoa from its source.<br>
> ><br>
> > Any idea?<br>
> ><br>
> > Zhaoxin<br>
> ><br>
<br>
</div></div>> ______________________________<wbr>_________________<br>
> swift-users mailing list<br>
> <a href="mailto:swift-users@swift.org" target="_blank">swift-users@swift.org</a><br>
> <a href="https://lists.swift.org/mailman/listinfo/swift-users" rel="noreferrer" target="_blank">https://lists.swift.org/mailma<wbr>n/listinfo/swift-users</a><br>
<br>
</blockquote></div><br></div>
</div></blockquote><blockquote type="cite"><div><span>______________________________<wbr>_________________</span><br><span>swift-users mailing list</span><br><span><a href="mailto:swift-users@swift.org" target="_blank">swift-users@swift.org</a></span><br><span><a href="https://lists.swift.org/mailman/listinfo/swift-users" target="_blank">https://lists.swift.org/<wbr>mailman/listinfo/swift-users</a></span><br></div></blockquote></div></div></div></blockquote></div><br></div>