2014-09-02 37 views
1

您可以使用--sdk選件的幾個不同選項運行Swift REPL。您可以運行:在Swift REPL中使用iphonesimulator sdk和macosx sdk有什麼區別?

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時,我的輸出會有什麼不同?

回答

2

桌面,設備仿真器和設備硬件有不同的構建目標:

 
SDK    Target 
macosx   OSX Desktop 
iphonesimulator iOS Simulator 
iphoneos   iOS Hardware 

目前,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之間切換,具體取決於您打算運行應用程序的位置。您不需要手動選擇這些設置。

參考

相關問題