当前位置:网站首页>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
边栏推荐
- 拖拽改变顺序
- 云呐|工单管理软件,工单管理软件APP
- 2022 Google CTF SEGFAULT LABYRINTH wp
- MySQL最基本的SELECT(查询)语句
- 各种语言,软件,系统的国内镜像,收藏这一个仓库就够了: Thanks-Mirror
- 黑马笔记---创建不可变集合与Stream流
- How to manage distributed teams?
- The difference between Tansig and logsig. Why does BP like to use Tansig
- Today's question -2022/7/4 modify string reference type variables in lambda body
- Use nodejs to determine which projects are packaged + released
猜你喜欢
LeetCode:1175. 质数排列
C language - array
Reptile practice (VI): novel of climbing pen interesting Pavilion
Yunna | work order management measures, how to carry out work order management
云呐|工单管理软件,工单管理软件APP
Dark horse notes - create immutable sets and streams
Typical problems of subnet division and super network construction
永久的摇篮
Send template message via wechat official account
新工作感悟~辞旧迎新~
随机推荐
数据手册中的词汇
The difference between Tansig and logsig. Why does BP like to use Tansig
初识MySQL
LeetCode:1175. 质数排列
图片打水印 缩放 和一个输入流的转换
swiper组件中使用video导致全屏错位
C language instance_ two
How to prevent overfitting in cross validation
uva 1401 dp+Trie
json学习初体验–第三者jar包实现bean、List、map创json格式
AcWing 344. Solution to the problem of sightseeing tour (Floyd finding the minimum ring of undirected graph)
Box stretch and pull (left-right mode)
Use nodejs to determine which projects are packaged + released
AcWing 1140. Shortest network (minimum spanning tree)
Add the applet "lazycodeloading": "requiredcomponents" in taro,
AcWing 1141. 局域网 题解(kruskalkruskal 求最小生成树)
Start from the bottom structure to learn the customization and testing of fpga---- FIFO IP
curl 命令
Yunna - work order management system and process, work order management specification
修改px4飞控的系统时间