当前位置:网站首页>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
边栏推荐
- 分享一个通用的so动态库的编译方法
- 各种语言,软件,系统的国内镜像,收藏这一个仓库就够了: Thanks-Mirror
- AI automatically generates annotation documents from code
- C language - array
- Long press the button to execute the function
- Let's see how to realize BP neural network in Matlab toolbox
- 修改px4飞控的系统时间
- Gin introduction practice
- 【C语言进阶篇】指针的8道笔试题
- AcWing 1148. 秘密的牛奶运输 题解(最小生成树)
猜你喜欢

1123. The nearest common ancestor of the deepest leaf node

AcWing 361. Sightseeing cow problem solution (SPFA seeking positive ring)

一文带你走进【内存泄漏】

鼠标右键 自定义

According to the analysis of the Internet industry in 2022, how to choose a suitable position?

域分析工具BloodHound的使用说明

JVM 内存模型

对C语言数组的再认识

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

dvajs的基础介绍及使用
随机推荐
对C语言数组的再认识
我如何编码8个小时而不会感到疲倦。
字符串转成日期对象
AcWing 346. 走廊泼水节 题解(推公式、最小生成树)
搭建【Redis in CentOS7.x】
curl 命令
Long press the button to execute the function
C语言实例_4
New job insights ~ leave the old and welcome the new~
AcWing 1148. 秘密的牛奶运输 题解(最小生成树)
Use nodejs to determine which projects are packaged + released
编译命令行终端 swift
JS reverse -- ob confusion and accelerated music that poked the [hornet's nest]
糊涂工具类(hutool)post请求设置body参数为json数据
移植DAC芯片MCP4725驱动到NUC980
Set up [redis in centos7.x]
7.6模拟赛总结
JS es5 peut également créer des constantes?
Clickhouse fields are grouped and aggregated, and SQL is queried according to the granularity of any time period
C language instance_ five