Software⏱️ 2 min read📅 2026-05-31

How to Fix: Xcode 10.2.1 Command PhaseScriptExecution failed with a nonzero exit code

Xcode command phase script execution failed with a nonzero exit code due to incorrect filter usage.

Quick Answer: Check and correct the filter options in the rsync command, ensuring that only necessary directories are excluded.

The 'Xcode 10.2.1 Command PhaseScriptExecution failed with a nonzero exit code' error is a common issue encountered by developers when building and running their iOS projects in Xcode. This error typically occurs due to issues with the Derived Data directory, which is used by Xcode to store temporary files during compilation.

⚠️ Common Causes

  • Incorrectly configured Derived Data directory
  • Outdated Xcode version
  • Incompatible project settings with the target device

🔧 Proven Troubleshooting Steps

Method 1: Clear Derived Data Directory

  1. Step 1: Open Xcode and go to Xcode > Preferences
  2. Step 2: Click on Locations in the left sidebar, then select Derived Data, and click Manage
  3. Step 3: Delete all entries from the list, then click Remove Selected Items
  4. Step 4: Restart Xcode and try building your project again

Method 2: Update Xcode Version

  1. Step 1: Open the App Store and search for 'Xcode'
  2. Step 2: Click on the 'Update' button to download the latest version
  3. Step 3: Install the updated version of Xcode and restart your Mac
  4. Step 4: Try building your project again in Xcode

🎯 Final Words

By following these steps, you should be able to resolve the 'Xcode 10.2.1 Command PhaseScriptExecution failed with a nonzero exit code' error and get back to developing your iOS projects without any issues.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions