How can i build a swift package without Xcode

Hi everyone,
I've been developing for the web for a long while and I decided to get into swift development.

I've been waiting for it to be possible do develop swift applications without Xcode,
the main reason is that Xcode is huge and clumsy, and I rather use my own carefully crafted dev environment.

Yesterday I have set up the language server to work with VScode by instaling the latest command-line tools. But I got stuck after trying to build a package I have just created and almost gave up.

What I did is to run swift package init on an empty folder, and then run swift build, but I get the error:

error: terminated(72): LESS_TERMCAP_us= LANG=en_US.UTF-8 SDKROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk LIBRARY_PATH=/usr/local/lib COLORTERM=truecolor PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin LSCOLORS=exfxcxdxbxGxDxabagacad CPATH=/usr/local/include TMPDIR=/var/folders/7m/yzw0xnh176j689fs0m77lvz00000gn/T/ SHLVL=1 PAGER=less LS_COLORS=di=34:ln=35:so=32:pi=33:ex=31:bd=36;01:cd=33;01:su=31;40;07:sg=36;40;07:tw=32;40;07:ow=33;40;07: LESS=-F -g -i -M -R -S -w -X -z-4 BROWSER=open COLORFGBG=15;0 TERM=xterm-256color LC_TERMINAL_VERSION=3.3.9 USER=samuelgozi LESS_TERMCAP_md= VISUAL=nano LC_CTYPE=UTF-8 GREP_COLORS=mt=37;45 LC_TERMINAL=iTerm2 LESS_TERMCAP_me= LESS_TERMCAP_so= TERM_SESSION_ID=w0t0p0:21993943-714D-4F83-A746-7F8849E06812 TERM_PROGRAM_VERSION=3.3.9 XPC_SERVICE_NAME=0 SSH_AUTH_SOCK=/private/tmp/ LOGNAME=samuelgozi ITERM_PROFILE=Samuel's Profile LESS_TERMCAP_mb= PWD=/Users/samuelgozi/Desktop/swiftUI XPC_FLAGS=0x0 GREP_COLOR=37;45 SHELL=/bin/zsh EDITOR=nano HOME=/Users/samuelgozi LESS_TERMCAP_se= OLDPWD=/Users/samuelgozi/Desktop ITERM_SESSION_ID=w0t0p0:21993943-714D-4F83-A746-7F8849E06812 _=/usr/bin/swift LESS_TERMCAP_ue= __CF_USER_TEXT_ENCODING=0x1F5:0x0:0x0 xcrun --sdk macosx --find xctest output:
    xcrun: error: unable to find utility "xctest", not a developer tool or in PATH

To be clear. Other than installing xcode command line tools i havent installed anything related, so I dont think i have the neccesary binaries. But how can I make it work without installing Xcode?

And Other than the IDE, what am I giving up while doing so? I'm planning on using SwiftUI, I don't need any visual tools other than the ability to run the code in debug mode.


I think on macOS you either need to install Xcode or the Swift toolchain from (I'm not sure if the second is good enough though). The command line tools are not enough run everything from the command line. Once you've downloaded it, then you're good to go.

In terms of building stuff, you won't be able to build anything outside of Xcode that relies on private Apple frameworks (like SwiftUI) as they won't be able to link to them

Thank you very much for replying and letting me know that I wont get far without XCode.
I hope it will be possible to work without it, it can bring many devs to the community.