当前位置:网站首页>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
边栏推荐
- C语言实例_4
- 454 Baidu Mianjing 1
- 拖拽改变顺序
- Google released a security update to fix 0 days that have been used in chrome
- 405 method not allowed appears when the third party jumps to the website
- Dark horse notes - exception handling
- 从零开始匹配vim(0)——vimscript 简介
- 前置机是什么意思?主要作用是什么?与堡垒机有什么区别?
- THREE. AxesHelper is not a constructor
- 安利一波C2工具
猜你喜欢
C语言关于链表的代码看不懂?一篇文章让你拿捏二级指针并深入理解函数参数列表中传参的多种形式
AI 从代码中自动生成注释文档
Dark horse notes - create immutable sets and streams
Make Jar, Not War
1123. 最深叶节点的最近公共祖先
dvajs的基础介绍及使用
1123. The nearest common ancestor of the deepest leaf node
云呐|工单管理软件,工单管理软件APP
Instructions for using the domain analysis tool bloodhound
Appium foundation - appium inspector positioning tool (I)
随机推荐
When grep looks for a process, it ignores the grep process itself
Add the applet "lazycodeloading": "requiredcomponents" in taro,
AcWing 346. 走廊泼水节 题解(推公式、最小生成树)
Google发布安全更新,修复Chrome中已被利用的0 day
405 method not allowed appears when the third party jumps to the website
According to the analysis of the Internet industry in 2022, how to choose a suitable position?
AcWing 1148. 秘密的牛奶运输 题解(最小生成树)
ZOJ Problem Set – 2563 Long Dominoes 【如压力dp】
How to prevent overfitting in cross validation
设置Wordpress伪静态连接(无宝塔)
AcWing 904. Wormhole solution (SPFA for negative rings)
DS-5/RVDS4.0变量初始化错误
图片打水印 缩放 和一个输入流的转换
Let's see how to realize BP neural network in Matlab toolbox
Yunna | work order management measures, how to carry out work order management
一起看看matlab工具箱内部是如何实现BP神经网络的
How to manage distributed teams?
子网划分、构造超网 典型题
AcWing 345. 牛站 题解(floyd的性质、倍增)
搭建【Redis in CentOS7.x】