gpt4 book ai didi

xcode - 如何在终端中使用 swift?

转载 作者:IT王子 更新时间:2023-10-29 04:56:09 26 4
gpt4 key购买 nike

我读了What's new in Xcode 6 .这篇文章介绍了一些关于 Xcode 6 的新特性,它说:

Command Line

Xcode’s debugger includes an interactive version of the Swift language, known as the REPL (Read-Eval-Print-Loop). Use Swift syntax to evaluate and interact with your running app or write new code in a script-like environment. The REPL is available from within LLDB in Xcode’s console, or from Terminal.

我想知道如何获取REPL?

最佳答案

sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer

然后您可以执行以下操作之一:

xcrun swift 
lldb --repl

从 Xcode 6.1 开始 - 在终端中输入 swift 也会启动 REPL。

关于xcode - 如何在终端中使用 swift?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24011120/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com