index rss mastodon twitter github linkedin email
Álvaro Ramírez

Álvaro Ramírez

23 August 2020 Swift package manager build for iOS

While playing around with Swift package manager, it wasn't immediately obvious how to build for iOS from the command line. The default behaviour of invoking swift build is to build for the host. In my case, macOS. In any case, this was it:

swift build -Xswiftc "-sdk" -Xswiftc "/Applications/" -Xswiftc "-target" -Xswiftc "x86_64-apple-ios13.0-simulator"

ps. Can get the SDK path with:

xcrun --sdk iphonesimulator --show-sdk-path