当前位置:网站首页>编译命令行终端 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
边栏推荐
- 让我们,从头到尾,通透网络I/O模型
- Send template message via wechat official account
- The cost of returning tables in MySQL
- Neon Optimization: an optimization case of log10 function
- 斗地主游戏的案例开发
- Atomic in golang and CAS operations
- Yunna | work order management measures, how to carry out work order management
- table表格设置圆角
- HMM 笔记
- Taro applet enables wxml code compression
猜你喜欢

阿里云中mysql数据库被攻击了,最终数据找回来了

How to manage distributed teams?

JTAG principle of arm bare board debugging
![[100 cases of JVM tuning practice] 05 - Method area tuning practice (Part 2)](/img/40/dc45df3cd3ee7642277eff899bc6aa.png)
[100 cases of JVM tuning practice] 05 - Method area tuning practice (Part 2)

MySQL script batch queries all tables containing specified field types in the database

Body mass index program, entry to write dead applet project

Make Jar, Not War

Js逆向——捅了【马蜂窝】的ob混淆与加速乐

Yunna | work order management measures, how to carry out work order management
![[hfctf2020]babyupload session parsing engine](/img/db/6003129bc16f943ad9868561a2d5dc.png)
[hfctf2020]babyupload session parsing engine
随机推荐
安利一波C2工具
Clickhouse fields are grouped and aggregated, and SQL is queried according to the granularity of any time period
Your cache folder contains root-owned files, due to a bug in npm ERR! previous versions of npm which
Let's see through the network i/o model from beginning to end
树莓派/arm设备上安装火狐Firefox浏览器
实现mysql与ES的增量数据同步
2022 Google CTF SEGFAULT LABYRINTH wp
Typical problems of subnet division and super network construction
接收用户输入,身高BMI体重指数检测小业务入门案例
[advanced C language] 8 written questions of pointer
Wood extraction in Halcon
Install Firefox browser on raspberry pie /arm device
C语言实例_3
2022 Google CTF segfault Labyrinth WP
云呐-工单管理制度及流程,工单管理规范
字节P7专业级讲解:接口测试常用工具及测试方法,福利文
NEON优化:性能优化常见问题QA
[Niuke] [noip2015] jumping stone
Google released a security update to fix 0 days that have been used in chrome
Asset security issues or constraints on the development of the encryption industry, risk control + compliance has become the key to breaking the platform