build_warnings
Extract and list all compiler warnings from the most recent Xcode build log. This tool parses the build output in derived data to surface warnings about deprecated APIs, type conversions, unused variables, and other issues the Swift or Clang compiler flags during compilation. Addressing these warnings improves code quality and prepares your project for future SDK changes.
Parameters
Section titled “Parameters”| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
projectPath | string | No | Current directory | Absolute path to the .xcworkspace or .xcodeproj file |
derivedDataPath | string | No | Xcode default | Absolute path to the derived data directory containing build logs |
Usage Examples
Section titled “Usage Examples”Check warnings for a project using default derived data
Section titled “Check warnings for a project using default derived data”“Show me all build warnings for FitnessTracker”
{ "projectPath": "/Users/dev/Projects/FitnessTracker/FitnessTracker.xcodeproj"}Check warnings with custom derived data
Section titled “Check warnings with custom derived data”“List build warnings using my custom derived data path”
{ "projectPath": "/Users/dev/Projects/FitnessTracker/FitnessTracker.xcodeproj", "derivedDataPath": "/tmp/FitnessTracker-DerivedData"}Check warnings for a workspace
Section titled “Check warnings for a workspace”“What warnings does my workspace build produce?”
{ "projectPath": "/Users/dev/Projects/FitnessTracker/FitnessTracker.xcworkspace"}Check warnings using all defaults
Section titled “Check warnings using all defaults”“Show me the build warnings for the project in the current directory”
{}Example Output
Section titled “Example Output”Build Warnings for FitnessTracker:
/Users/dev/Projects/FitnessTracker/FitnessTracker/Services/HealthKitManager.swift:45:9: warning: 'authorizationStatus(for:)' was deprecated in iOS 18.0: Use statusForAuthorizationType(_:) instead
/Users/dev/Projects/FitnessTracker/FitnessTracker/ViewModels/WorkoutViewModel.swift:23:13: warning: Variable 'tempResult' was written to, but never read
/Users/dev/Projects/FitnessTracker/FitnessTracker/Views/ActivityChartView.swift:67:28: warning: Conversion from 'Int' to 'Double' may lose precision
/Users/dev/Projects/FitnessTracker/FitnessTracker/Models/LegacyDataStore.swift:12:1: warning: 'NSKeyedUnarchiver.unarchiveObject(withFile:)' was deprecated in iOS 12.0: Use +unarchivedObjectOfClass:fromData:error: instead
/Users/dev/Projects/FitnessTracker/FitnessTracker/Networking/APIEndpoints.swift:34:9: warning: Result of call to 'append(_:)' is unused
Summary: 5 warnings across 5 filesWhen no warnings are found:
Build Warnings for FitnessTracker:
No warnings found in the most recent build. Clean build!Related Tools
Section titled “Related Tools”swiftlint_run— Check for style violations that the compiler does not catchswiftlint_fix— Auto-fix code style issues alongside compiler warning resolutionxcode_build— Build the project first to generate the build log that this tool readsswift_format_run— Check formatting after resolving compiler warnings