Running a Scan
Run your first scan
Section titled “Run your first scan”From your project directory, start with Periphery’s guided setup:
periphery scan --setupThe guided setup detects your project type and configures a few options. After answering a few questions, Periphery prints the full scan command and runs it.
The guided setup is intended to get you started. Run periphery help scan to see all available scan options.
How a scan works
Section titled “How a scan works”Periphery builds your project to generate an index store, combines it with information parsed from the source files, and maps the relationships between declarations. It then reports declarations that cannot be reached from the project’s entry points.
If your project consists of one or more standalone frameworks that do not also contain some kind of application that consumes their interfaces, you need to tell Periphery to assume that all public declarations are used with the --retain-public option.
For projects that are mixed Objective-C & Swift, it’s highly recommended you read about the implications this can have on your results.
Next Steps
Section titled “Next Steps”Once you’ve settled upon the appropriate options for your project, persist them in a YAML configuration file so you can simply run periphery scan. See Configuration for the full list of options.
To use Periphery in CI, see Continuous Integration. If your project already contains a lot of unused code, Baselines let you report only newly introduced results.