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

The “Command PhaseScriptExecution failed with a nonzero exit code” error message in Xcode typically indicates an issue with an application or script execution.

Thankfully, there are steps you can take to troubleshoot and resolve this problem.

Solution #1: Refreshing Pod Dependencies

Step 1: Open the Terminal app and navigate to your Xcode project folder.

Step 2: Execute the following commands in order:

pod deintegrate

pod install

Step 3: Return to Xcode, and navigate to Product > Clean Build Folder.

Step 4: Re-run your application.

This process helps ensure that your project’s dependencies are properly configured and up to date.

Solution #2: Modifying … Files


source=”$(readlink “${source}”)”


source=”$(readlink -f “${source}”)”

Solution #3: Resetting Keychain Access

  1. Open Keychain Access.
  2. Locate and select the login option, then choose Lock & Unlock Again.
  3. In Xcode, go to Product > Clean Build Folder.
  4. Retry building your application.

Resetting Keychain Access can sometimes resolve authentication-related issues that may be causing the error.

Solution #4: Checking for Special Characters in File Paths

Ensure that your project’s file paths do not contain any special characters. Spaces or other symbols may cause issues during the build process.

Solution #5: Reviewing Script Phase Outputs

  1. In Xcode, navigate to your project’s Build Phases.
  2. Review any custom scripts or build rules for potential issues. Scripts that reference missing files can trigger this error.

Solution #6: Adjusting Build Settings for ARM64 (M1 Macs)

If you are using an M1 Mac, consider adding ARM64 to the Excluded Architectures build setting for “Any iOS Simulator SDK.” This can help prevent build failures related to architecture compatibility.

If none of the above solutions work, consider reaching out to Apple Support for further assistance. They have dedicated resources to help developers resolve complex issues.

Leave a Comment

Leave a Comment

Cydia Geeks