【问题标题】:What is the difference between using the iphonesimulator sdk and the macosx sdk in the Swift REPL?在 Swift REPL 中使用 iphonesimulator sdk 和 macosx sdk 有什么区别?
【发布时间】:2014-09-02 22:23:29
【问题描述】:

您可以使用 --sdk 选项的几个不同选项来运行 Swift REPL。你可以运行:

xcrun swift -v -sdk $(xcrun --show-sdk-path --sdk iphonesimulator)

xcrun swift -v -sdk $(xcrun --show-sdk-path --sdk macosx)

还有

xcrun swift -v -sdk $(xcrun --show-sdk-path --sdk iphoneos)

这似乎不能很好地工作并导致很多错误。
使用 iphonesimulator sdk 与 macosx sdk 时,我的输出有何不同?

【问题讨论】:

    标签: ios xcode macos swift read-eval-print-loop


    【解决方案1】:

    桌面、设备模拟器和设备硬件是不同的构建目标:

    SDK 目标 macosx OSX 桌面 iphonesimulator iOS 模拟器 iphoneos iOS 硬件

    目前,xcodebuild 支持以下平台:

     OS X           The local Mac, referred to in the Xcode interface as My Mac, and which supports the fol-lowing following
                    lowing keys:
    
                    arch  The architecture to use, either x86_64 (the default) or i386.
    
     iOS            An iOS device, which supports the following keys:
    
                    name  The name of the device to use.
    
                    id    The identifier of the device to use, as shown in the Devices tab of the Xcode
                          Organizer.
    
     iOS Simulator  The iOS Simulator, which supports the following keys:
    
                    name  The full name of device to simulate, as presented in Xcode's UI.
    
                    OS    The version of iOS to simulate, such as 6._, or the string latest (the default) to
                          indicate the most recent version of iOS supported by this version of Xcode.
    

    这是在 IDE 中抽象出来的:

    对于 iOS,Xcode 会自动在 iOS 模拟器 SDK 和设备 SDK 之间切换,具体取决于您打算在哪里运行应用程序。您无需手动选择这些设置。

    参考文献

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-02-20
      • 2011-09-27
      • 2016-10-16
      • 2017-05-29
      • 2019-09-29
      • 1970-01-01
      • 2014-10-26
      • 1970-01-01
      相关资源
      最近更新 更多