iOS app development without Xcode

Set up VSCode/Cursor for iOS app development without running XCode too much

Since the day I got a Macbook about 10 years ago, I tried to use Xcode a couple of times. For some reason, the IDE gives me a lot of headaches. Perhaps it’s the keybindings I would have to get used to, the Home button not going to the start of the line, the weird tabs at the left for navigation, use the mouse for everything or just the whole package.

There is also this little thing called LLMs that are not integrated at all within Xcode.

So, I was looking for quite some time for an alternative. Unfortunately, developing iOS apps completely outside Xcode is almost impossible. For example, there is no way to preview any views or debug anything as far as I know.

The setup I am using these days is Tuist together with VS Code / Cursor & the Sweetpad extension. The setup has some quirks, but it works better for me than Xcode.

Disclaimer: I am by no means an Apple ecosystem development expert. I’ve been living inside Visual Studio (the not Code one) for most of my professional life so that might explain my dislike for Xcode a bit.

Xcode

Even though the IDE is not very nice, you are going to get a lot of goodies when installing Xcode. When the installation is done, you have all the build tools, device simulator, debugger and IDE. This is all you need to build any Apple native apps. And if you haven’t tried it before, give Xcode a try. Perhaps you will like it so much that you can skip the rest of the article.

Tuist & Friends

Make sure tuist and xcode-build-server are installed:

brew install tuist xcode-build-server

Tuist is a “virtual platform team for mobile developers who ship”. It gives me mostly new project scaffolding, Xcode project generation and a nice interface to build and run an app locally. I am sure it has other benefits when working in a team or on a big app, but I am just one person who builds a small side-project.

The xcode-build-server is one of the available LSPs that supports all languages Xcode supports.

If you want to use Sweetpad also install that extension in VSCode / Cursor / Another AI enabled fork.

Creating an app

Open a terminal and run:

tuist init

Tuist asks some questions, so create a generated project named TuistTestApp for iOS and no server features.

The build tools, xcode-build-server, Sweetpad and other tools also still need Xcode project & workspace files. These can be generated by running the following command:

tuist generate

This generates the Tuist package and opens Xcode. Build & run the app from Xcode to make sure that everything there works at least. If you need to regenerate the project files, use tuist generate --no-open to not open the project in Xcode.

VSCode & Sweetpad

Generate a buildServer.json file from the VSCode menu (F1 -> 'Sweetpad: Generate build server config (buildServer.json)'). Very important to have this, otherwise nothing works :)

The generated config file contains the path to the xcode-build-server, supported languages and paths to the workspace.

Run Simulator

I prefer running the app in the simulator from the commandline:

open -a Simulator && tuist run TuistTestApp

Weird things & Notes

  • LSP diagnostics messages show up twice. I am not sure if this is part of my setup (very likely) or something going wrong in Sweetpad with Tuist
  • New files are (very often) not recognized by the LSP after they have been saved. This requires a restart of the extension in VSCode. Usually, I just restart the whole extension host (incredibly inconvenient) after regenerating the project.
  • When using Sweetpad & Tuist it is very important to build & run the generated app code from XCode. If omitted, the LSP / Sweetpad will hightlight errors. I’m not sure why, but things like ContentView are not recognized, even though the implementation exists, the build succeeds in Xcode, and the simulator has no issues running the compiled app.
  • Once everything is working, you are free to move folders around. Do keep in mind to update the buildServer.json for any locations. You might also have to delete the existing xcode project and regenerate & build the project.
  • Debugging is still better in XCode
Logo

Let's Connect!

Curious what I can do for your business? Reach out and let's discuss how I can help you achieve your goals.

Send me an email or find me on LinkedIn.