当前位置:网站首页>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
边栏推荐
- LeetCode. 剑指offer 62. 圆圈中最后剩下的数
- Instructions for using the domain analysis tool bloodhound
- Byte P7 professional level explanation: common tools and test methods for interface testing, Freeman
- AcWing 1148. Secret milk transportation problem solution (minimum spanning tree)
- What does security capability mean? What are the protection capabilities of different levels of ISO?
- AcWing 346. Solution to the problem of water splashing festival in the corridor (deduction formula, minimum spanning tree)
- Appium自动化测试基础 — uiautomatorviewer定位工具
- 今日问题-2022/7/4 lambda体中修改String引用类型变量
- POJ 3177 Redundant Paths POJ 3352 Road Construction(双连接)
- Clickhouse fields are grouped and aggregated, and SQL is queried according to the granularity of any time period
猜你喜欢
【信号与系统】
Reptile practice (VI): novel of climbing pen interesting Pavilion
[advanced C language] 8 written questions of pointer
Appium automation test foundation uiautomatorviewer positioning tool
百度飞将BMN时序动作定位框架 | 数据准备与训练指南 (上)
从底层结构开始学习FPGA----FIFO IP的定制与测试
AcWing 345. Cattle station solution (nature and multiplication of Floyd)
AcWing 1148. Secret milk transportation problem solution (minimum spanning tree)
JVM 内存模型
百度飞将BMN时序动作定位框架 | 数据准备与训练指南 (下)
随机推荐
Hutool post requests to set the body parameter to JSON data
swiper组件中使用video导致全屏错位
一文带你走进【内存泄漏】
THREE. AxesHelper is not a constructor
C language - array
黑马笔记---异常处理
Instructions for using the domain analysis tool bloodhound
从底层结构开始学习FPGA----FIFO IP的定制与测试
制作带照明的DIY焊接排烟器
Gin introduction practice
Baidu flying general BMN timing action positioning framework | data preparation and training guide (Part 1)
Today's question -2022/7/4 modify string reference type variables in lambda body
云呐|工单管理办法,如何开展工单管理
DS-5/RVDS4.0变量初始化错误
C语言实例_2
域分析工具BloodHound的使用说明
grep查找进程时,忽略grep进程本身
Appium foundation - appium inspector positioning tool (I)
LeetCode:1175. Prime permutation
Set up [redis in centos7.x]