Starting with version 1.3.0 of Sw!ftalyzer (released February 2025), you’re able to start Sw!ftalyzer via a command. This enables the integration of Sw!ftalyzers extensive analysis into existing CI/CD flows and other kinds of automations.
Launching Sw!ftalyzer
Use this command to start the analysis of your project:
open /path/to/Sw\!ftalyzer.app --args --path /path/to/project.xcodeproj --output /path/to/output/directory
This executes the open
command to launch Sw!ftalyzer and passes two arguments to it: --path
and --output
. The first one, path
, specifies the path to the project or workspace file that’s to be analyzed. The value for the output
argument defines a place where the result of the analysis will be saved at.
The output consists of 4 files:
- The persisted analysis file to open in Sw!ftalyzer.
- An image of the top-level dependency graph as a jpg file.
- A csv file containing metrics and statistics for further analysis.
- A pdf file listing warnings of warnings found in the analysis of the project for investigations.
Please note the “\” in front of “!” in the app name in the path to Sw!ftalyzer.
Prerequisites
Before Sw!ftalyzer can execute the analysis, you need to meet some requirements. Sw!ftalyzer will guide you through the steps after executing the command. Once set up, following automated launches of Sw!ftalyzer don’t require these actions again.
- Make sure your subscription is active.
- Give access to all files, including the analyzed project files, Xcodes derived data directory and the output directory.