How can I use swift in Terminal?

后端 未结 13 597
北荒
北荒 2020-11-29 15:28

I read What\'s new in Xcode 6. The article introduces some new feature about Xcode 6, and it says:

Command Line

Xcode’s debugger includes an inter

13条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-29 16:15

    For XCode6, run these commands:

    $ sudo xcode-select -s /Applications/Xcode.app/Contents/Developer/
    
    $ xcrun swift
    

    If you get an error:

    :0: error: the SDK 'MacOSX10.9.sdk' does not support Swift
    

    try:

    xcrun swift -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk
    

提交回复
热议问题