And the licensing agreement. How do I do it on Linux with no Mac or iOS?
Swift is available for Linux, license is Apache 2.0. There's even swift bindings for some linux ecosystem libraries, e.g. adwaita-swift for writing gnome apps and qt bindings for writing kde apps.
Swift has builds for Linux: https://www.swift.org/install/linux/
The license is pretty much Apache 2.0
You can develop Swift without it. I assume you mean SwiftUI / apple's sdk, which is what most people assume (a note, I'd say, to advocates of Swift who wish not to address SwiftUI: it's the biggest target, and its poor performance on it should speak volumes about the language).
You can also sometimes avoid xcode, see https://github.com/xtool-org/xtool
although, at this point, just use expo!