当前位置:网站首页>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 ./testPublisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/116893.html Link to the original text :https://javaforall.cn
边栏推荐
- Transplant DAC chip mcp4725 to nuc980
- New job insights ~ leave the old and welcome the new~
- 域分析工具BloodHound的使用说明
- 子网划分、构造超网 典型题
- 各种语言,软件,系统的国内镜像,收藏这一个仓库就够了: Thanks-Mirror
- 从底层结构开始学习FPGA----FIFO IP的定制与测试
- C language instance_ four
- AcWing 344. 观光之旅题解(floyd求无向图的最小环问题)
- 云呐-工单管理制度及流程,工单管理规范
- 前置机是什么意思?主要作用是什么?与堡垒机有什么区别?
猜你喜欢

爬虫实战(六):爬笔趣阁小说

新工作感悟~辞旧迎新~

场景实践:基于函数计算快速搭建Wordpress博客系统

我如何编码8个小时而不会感到疲倦。

C语言关于链表的代码看不懂?一篇文章让你拿捏二级指针并深入理解函数参数列表中传参的多种形式

Your cache folder contains root-owned files, due to a bug in npm ERR! previous versions of npm which

454-百度面经1

云呐-工单管理制度及流程,工单管理规范

Reptile practice (VI): novel of climbing pen interesting Pavilion

Set WordPress pseudo static connection (no pagoda)
随机推荐
736. LISP syntax parsing: DFS simulation questions
swiper组件中使用video导致全屏错位
Docker method to install MySQL
设置Wordpress伪静态连接(无宝塔)
MySQL最基本的SELECT(查询)语句
拖拽改变顺序
公钥\私人 ssh避password登陆
ZOJ problem set – 2563 long dominoes [e.g. pressure DP]
机器学习:随机梯度下降(SGD)与梯度下降(GD)的区别与代码实现。
AcWing 1148. 秘密的牛奶运输 题解(最小生成树)
域分析工具BloodHound的使用说明
云呐-工单管理制度及流程,工单管理规范
长按按钮执行函数
移植DAC芯片MCP4725驱动到NUC980
Start from the bottom structure to learn the customization and testing of fpga---- FIFO IP
Go zero micro service practical series (IX. ultimate optimization of seckill performance)
How to manage distributed teams?
LeetCode:1175. Prime permutation
Box stretch and pull (left-right mode)
How to prevent overfitting in cross validation