Here be dragons!

Here I will be learning in public about Tuist. I make no guarantees that any of this information is accurate or up to date.

?: How do I configure the default project that is created by tuist?

I’m working through Create a new project | Tuist in the Tuist docs. I ran tuist init and the project that it created included a .storyboard file. I have no need of this file. How do I edit the default project that tuist generates?

✅: How do I code sign?

A project generated by Tuist won’t build initially because it isn’t signed. Tuist can generate an xcode project that has automatic signing turned on, but to do that we need to tell Tuist what our team is. So let:

  1. Get our team code
  2. Put the team code in our tuist manifest
  3. Generate our project

Get the team code

To get the team code, find an xcode project which already has the team that you want to use for signing. Right-click the .xcodeproj file in Finder and chose “Show Package Contents”. Then look for the project.pbxproj file and open it in a text editor. I like to use VS Code. In your editor, search for DEVELOPMENT_TEAM. There should be a value that is about 10 digits long with numbers and letters. Copy this value.

Put the code in your tuist manifest file

Now open terminal inside your projects directory and run tuist edit. This will generate a new Xcode project that will allow you to edit your tuist manifest. Now open Project.swift. After dependencies: add:

settings: .settings(base: SettingsDictionary().automaticCodeSigning(devTeam: "MYTEAMCODE"), configurations: [])

It doesn’t have to be exactly like this. The important part that I want to draw your attention to is .automaticCodeSigning(devTeam: "MYTEAMCODE"). This tells Xcode to add automatically sign your target using that particular team. (Remember that you’ll need to add this same setting for each target.)

Now simply run tuist generate in the terminal and you should have a new xcode project with the code signing added.

Or you could tell tuist to put the automatic code signing in the xcconfig instead.