您可以使用不同的选项来运行Swift REPL命令,以满足--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时,我的输出将有什么不同?