Tuist and XcodeGen

A short review

Mobile@Exxeta
4 min readApr 20, 2023
Photo by Nils Huenerfuerst on Unsplash

With new projects and tasks, we are facing different technical challenges. Especially when dealing with iOS projects and working in a larger team, problems can arise. There are several possibilities to simplify the work of the team and to focus on more pleasing things like the development.

In this article, we will look at the frameworks Tuist and XcodeGen. These can help us manage the iOS project and resolve conflicts that may arise, especially when merging the project file.

Tuist

The Tuist documentation describes the framework as follows:

Tuist is a command line tool (CLI) that aims to facilitate the generation, maintenance, and interaction with Xcode projects. It’s distributed as a binary, which you can easily install and use without having to depend on other tools to manage dependencies (like you would do if the tool was written in other programming languages such as Ruby, or Java).

It is exactly the three points mentioned above that we want to use for ourselves and from which we want to take advantage for our teams.

In order to learn more about Tuist, the following facts are important:

  • Tuist is developed in Swift and developers can write configuration files in Swift.
  • Even external dependencies can be integrated in a simple way. Support for Carthage and Swift Package Manager is also available. The inclusion of CocoaPods is possible, but there are some workarounds necessary.
  • Besides creating the “.workspace” file, creation of release pipelines and integration of GitHub Actions or Bitrise are supported by Tuist.
  • There is one important feature that both tools fulfill. The .xcodeproj file can be removed and it is not shared via version control. Consequently, this will lead to a high reduction in merge conflicts, which contributes to a smooth development process.
  • Tuist’s availability of a caching mechanism is currently the biggest difference with XcodeGen.

In connection with the last point, the following excerpt from the documentation is important:

Tuist has support for caching a pre-compiled version of your project targets locally and remotely. When targets are cached, developers can generate projects where the targets they don’t plan to work on are replaced with their pre-compiled version. In modular apps, this feature yields significant improvements in build times.

XcodeGen

XcodeGen describes itself as follows:

XcodeGen is a command line tool written in Swift that generates your Xcode project using your folder structure and a project spec.
The project spec is a YAML or JSON file that defines your targets, configurations, schemes, custom build settings and many other options. All your source directories are automatically parsed and referenced appropriately while preserving your folder structure. Sensible defaults are used in many places, so you only need to customize what is needed. Very complex projects can also be defined using more advanced features.

An important difference shows up in the first sentence. XcodeGen is written in Swift, just like Tuist. But the configuration is done with YAML or JSON. At this point, it is important to mention that Tuist is a lot younger than XcodeGen.

Both tools are backed by a strong community and their focus is to serve it.

Stars on GitHub:

  • Tuist: 3.3k
  • Xcode Gen: 6.1K

It is also possible to use and specify pre- and post-scripts. This allows to adapt to many circumstances of the project.

The Swift configuration language is an advantage of Tuist and XcodeGen. They fit well into the ecosystem. XcodeGen has a shorter configuration file and looks simpler as it has fewer functions. In direct comparison and without considering automated project creation, XcodeGen offers less functionality. However, this is not a deal-breaker. Whichever tool best suits your requirements is recommended.

Conclusion

We use the tools in various projects we are currently working on and can therefore say from experience that integrating the tools into existing projects is also easy.

The scope of the respective app is often important for the choice. Here it is still important to mention that Tuist has its focus on creation, development and the release process. XcodeGen focuses only on the first two steps. If a simple solution without too many tools is needed, Tuist is the better choice. Besides the language and the release process, the best way to choose a tool is to test them and check which behavior fits the best.

The development of both is heavily driven by the community. This gives us many advantages and allows us to integrate well. Like fast bug fixes and feature requests. New integrations for major versions will be developed quickly and provided for the community. Questions and problems can be solved in a short time.

In our team-oriented way of working, the tools help us a lot in making the development process very comfortable.
(by Alexander Holley)

Now… Don’t miss out on checking out the following links:

--

--

Mobile@Exxeta

Passionate people @ Exxeta. Various topics around building great solutions for mobile devices. We enjoy: creating | sharing | exchanging. mobile@exxeta.com