当前位置:网站首页>Compile command line terminal swift
Compile command line terminal swift
2022-07-07 01:42:00 【Full stack programmer webmaster】
Hello everyone , I meet you again , I'm the king of the whole stack
So, this is where swift lives, after you've installed XCode 6 Beta:
/Applications/Xcode6-Beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift
Also, there's a directory named swift which has various libraries:
/Applications/Xcode6-Beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift
To start playing in a terminal:
export PATH=/Applications/Xcode6-Beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin:$PATH
You could also change this in XCode 6's Preferences.
I use it via xcrun:
$ xcrun swift -v -o test test.swift
Swift version 1.0 (swift-600.0.34.4.5)
Target: x86_64-apple-darwin14.0.0
/Applications/Xcode6-Beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift -frontend -c -primary-file test.swift -enable-objc-attr-requires-objc-module -target x86_64-apple-darwin14.0.0 -module-name test -sdk /Applications/Xcode6-Beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk -color-diagnostics -o /var/folders/2p/rs8p19s957ggyxzntnj3tp_40000gn/T/test-bb5ff8.o
/usr/bin/ld /var/folders/2p/rs8p19s957ggyxzntnj3tp_40000gn/T/test-bb5ff8.o -force_load /Applications/Xcode6-Beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/libarclite_macosx.a -syslibroot /Applications/Xcode6-Beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk -lSystem -arch x86_64 -L /Applications/Xcode6-Beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx -rpath /Applications/Xcode6-Beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx -macosx_version_min 10.10.0 -no_objc_category_merging -o test
Note however the swift libraries are loaded (via @rpath) from /Applications/Xcode6-Beta/.../swift/macosx so the binary won't work on another system unless it's got the same version of Xcode installed in the same place. Unless you want to do lots of copying/install_name_tool calls to sort it out...
$ otool -l test |fgrep path
name @rpath/libswiftAppKit.dylib (offset 24)
name @rpath/libswiftCoreGraphics.dylib (offset 24)
name @rpath/libswiftDarwin.dylib (offset 24)
name @rpath/libswiftDispatch.dylib (offset 24)
name @rpath/libswiftFoundation.dylib (offset 24)
name @rpath/libswiftObjectiveC.dylib (offset 24)
name @rpath/libswift_stdlib_core.dylib (offset 24)
path /Applications/Xcode6-Beta.app/Contents/Developer/Toolchains/XcodeDefault.x
1. install xcode 6 beta
2. Set the path :
export PATH=/Applications/Xcode6-Beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin:$PATH
3. vim test.swift
println("Hello swift")
4.
xcrun swift -v -o test test.swift
5 ./test
Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/116893.html Link to the original text :https://javaforall.cn
边栏推荐
- 405 method not allowed appears when the third party jumps to the website
- Share a general compilation method of so dynamic library
- swiper组件中使用video导致全屏错位
- AcWing 344. 观光之旅题解(floyd求无向图的最小环问题)
- 2022 Google CTF segfault Labyrinth WP
- Typical problems of subnet division and super network construction
- Appium foundation - appium inspector positioning tool (I)
- [signal and system]
- ZOJ Problem Set – 2563 Long Dominoes 【如压力dp】
- Taro applet enables wxml code compression
猜你喜欢
AcWing 361. 观光奶牛 题解(spfa求正环)
Baidu flying general BMN timing action positioning framework | data preparation and training guide (Part 2)
Appium自动化测试基础 — uiautomatorviewer定位工具
JVM 内存模型
Reptile practice (VI): novel of climbing pen interesting Pavilion
AcWing 345. 牛站 题解(floyd的性质、倍增)
Send template message via wechat official account
Comparison of picture beds of free white whoring
The cradle of eternity
454-百度面经1
随机推荐
场景实践:基于函数计算快速搭建Wordpress博客系统
1123. The nearest common ancestor of the deepest leaf node
Appium foundation - appium inspector positioning tool (I)
2022 Google CTF segfault Labyrinth WP
移植DAC芯片MCP4725驱动到NUC980
一起看看matlab工具箱内部是如何实现BP神经网络的
AcWing 1141. LAN problem solving (kruskalkruskal finding the minimum spanning tree)
子网划分、构造超网 典型题
数据手册中的词汇
新工作感悟~辞旧迎新~
What does front-end processor mean? What is the main function? What is the difference with fortress machine?
Taro applet enables wxml code compression
Spark TPCDS Data Gen
今日问题-2022/7/4 lambda体中修改String引用类型变量
Start from the bottom structure to learn the customization and testing of fpga---- FIFO IP
THREE. AxesHelper is not a constructor
json学习初体验–第三者jar包实现bean、List、map创json格式
【C语言进阶篇】指针的8道笔试题
AcWing 1140. Shortest network (minimum spanning tree)
C语言实例_4