当前位置:网站首页>编译命令行终端 swift
编译命令行终端 swift
2022-07-06 17:56:00 【全栈程序员站长】
大家好,又见面了,我是全栈君
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. 安装xcode 6 beta
2. 设置路径:
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
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/116893.html原文链接:https://javaforall.cn
边栏推荐
- Neon Optimization: summary of performance optimization experience
- AI 从代码中自动生成注释文档
- c语言—数组
- Machine learning: the difference between random gradient descent (SGD) and gradient descent (GD) and code implementation.
- C# 计算农历日期方法 2022
- Gazebo的安装&与ROS的连接
- Taro applet enables wxml code compression
- [signal and system]
- 【信号与系统】
- Google released a security update to fix 0 days that have been used in chrome
猜你喜欢
Make Jar, Not War
JTAG principle of arm bare board debugging
2022 Google CTF SEGFAULT LABYRINTH wp
Go zero micro service practical series (IX. ultimate optimization of seckill performance)
Do you understand this patch of the interface control devaxpress WinForms skin editor?
[Niuke] [noip2015] jumping stone
HMM notes
Clickhouse fields are grouped and aggregated, and SQL is queried according to the granularity of any time period
1123. 最深叶节点的最近公共祖先
tansig和logsig的差异,为什么BP喜欢用tansig
随机推荐
How to evaluate load balancing performance parameters?
AI automatically generates annotation documents from code
405 method not allowed appears when the third party jumps to the website
Send template message via wechat official account
Your cache folder contains root-owned files, due to a bug in npm ERR! previous versions of npm which
UI control telerik UI for WinForms new theme - vs2022 heuristic theme
C language - array
The MySQL database in Alibaba cloud was attacked, and finally the data was found
交叉验证如何防止过拟合
Segmenttree
Yunna | work order management software, work order management software app
Atomic in golang, and cas Operations
Taro中添加小程序 “lazyCodeLoading“: “requiredComponents“,
Gazebo的安装&与ROS的连接
接收用户输入,身高BMI体重指数检测小业务入门案例
前置机是什么意思?主要作用是什么?与堡垒机有什么区别?
机器学习:随机梯度下降(SGD)与梯度下降(GD)的区别与代码实现。
Force buckle 1037 Effective boomerang
身体质量指数程序,入门写死的小程序项目
C language instance_ five