SPM Plugin that generate Schemes for the selected modules

What's New



Fix overwriteAlreadyGeneratedSchemes parameter

Scheme Generator

⚠️ This is in beta.

Scheme Generator is a Swift Package Manager Plugin for quickly updating your Schemes files. It is a great tool for a project that is modularized or that uses TCA.


Add to your dependencies .package(url: "", from: "0.5.5"),.

This plugin works with Xcode 14.1 / 14.0.

Basic usage

The plugin will display messages and errors in Xcode Report navigator.

step description img
0 To run it right click on the package you want to run it on. Capture d’écran 2022-10-21 à 13 16 35
1 It will propose you to run it you can provide an optional argument(--confFile newName.json) that will allow you to change the name of the configuration file. Once change the new configuration file name will be stored Capture d’écran 2022-10-21 à 13 38 29
2 At first launch, it will ask for permission to write files into the schemesDirectory for it to work you have to select "Allow Command to Change Files". Capture d’écran 2022-10-21 à 01 35 07

If the schemesDirectory point to inside a workspace project.xcworkspace/xcshareddata/xcschemes you might need to restart Xcode to see all your schemes updated.

How to use in CLI

You can then invoke the plugin from the root of your repository like so:

swift package plugin scheme-generator

This will generate schemes for all compatible targets defined in your package and write them in schemesDirectory.

Notice that you must also passed --allow-writing-to-directory option to SwiftPM. Otherwise SwiftPM will throw an error as it's a sandbox violation for a plugin to write to a package directory without explicit permission.

You can pass --confFile newName.json to scheme-generator in order to change the default path for the configuration. It will be saved so that you will not be required to input the configuration fileName at each launch.


To use it you have to set a configuration file at the root of your project named schemeGenerator.json. This file contains these keys:

  • schemesDirectory: A string that represents where the schemes will be saved(if you use TCA you can put it in workspace)
  • removeNotGeneratedSchemes: A bool that represents if it should remove schemes that are no longer in Package.swift
  • overwriteAlreadyGeneratedSchemes: A bool that represents if it should force the overwrite of schemes already present scheme
  • excludedSchemes: An array of String that represents the name of the schemes files that already exist and should not be processed
  • verbose: A bool that represents if it should print more information in the console
  "schemesDirectory": "Project/project.xcworkspace/xcshareddata/xcschemes",
  "excludedSchemes": ["Target1Tests", "Target2Tests"],
  "removeNotGeneratedSchemes": true,
  "overwriteAlreadyGeneratedSchemes": false,
  "verbose": true

If a new configuration filename is used as explained in #basic-usage step 1. It will be saved so that you will not be required to input the configuration fileName at each launch.

How Does it Work?

It loads its configuration to figure out what it can do and where to apply it. Then it loads all the products from the Package.swift. Apply a filter to do just what is required then wrote the files in the schemesDirectory.

The scheme is based on a template.


  • Swift Tools 5.7.0
View More Packages from this Author


  • None
Last updated: Thu Nov 23 2023 00:30:13 GMT-1000 (Hawaii-Aleutian Standard Time)