Before setting up Xcode integration, we highly recommend you first get Periphery working in a terminal, as we'll be using the exact same command via Xcode. Instructions for using Periphery can be found in the Using Periphery section.
Step 1: Create an Aggregate Target
Select your project in the Project Navigator and click the + button at the bottom left of the Targets section.
Select Cross-platform and choose Aggregate. Hit Next.
Choose a name for the new target, e.g "Periphery" or "Unused Code".
Step 2: Add a Run Script Build Phase
In the Build Phases section click the + button to add a new Run Script phase.
In the shell script window enter the Periphery command. Be sure to include the
--format xcode option.
Step 3: Select & Run
You're ready to roll. You should now see the new scheme in the dropdown. Select it and hit run.
Note: If you'd like others on your team to be able to use the scheme, you'll need to mark it as Shared. This can be done by selecting Manage Schemes... and selecting the Shared checkbox next to the new scheme. The scheme definition can now be checked into source control.