swift.org has tutorials for command line applications. Have you tried a simple main function without anything else?
this post was submitted on 09 Jun 2024
2 points (100.0% liked)
iOS
1149 readers
1 users here now
The home for all things iOS on LW.
Rules:
- No NSFW Content.
- No hate speech or personal attacks.
- No Ads / Spamming.
founded 1 year ago
MODERATORS
I haven't tried anything yet, I kinda just had the thought today that there must be a way to run Swift stuff just for testing and practical purposes.
Is that like the @main thing in the App.swift section of regular XCode projects?
I checked and you can do everything with the command line: https://www.swift.org/getting-started/cli-swiftpm/
It makes sense because servers and CI don’t need Xcode or a screen to build applications, everything is automated somehow.