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

How to Fix code 1 Error – how to fix the issue "Command /bin/sh failed with exit code 1" in iphone

Error fixing command /bin/sh failed with exit code 1 in iPhone application.

Quick Answer: Check if the DerivedData folder is set to delete on close, and try cleaning the project by going to Product > Clean Build Folder.

The error 'Command /bin/sh failed with exit code 1' is a common issue encountered when using static libraries in Xcode. This occurs due to the compiler being unable to find the necessary header files or libraries required by the static library.

🔍 Why This Happens

  • The static library is not properly configured or linked to the project.

🛠️ Step-by-Step Verified Fixes

Method 1: Clean and Rebuild the Project

  1. Step 1: Go to Product > Clean Build Folder in Xcode.

Method 2: Update Library Settings

  1. Step 1: Open the project navigator and select the static library.

Method 3: Verify Library Configuration

  1. Step 1: Check the library's .pbxuser file for any incorrect paths or settings.

💡 Conclusion

By following these steps, you should be able to resolve the 'Command /bin/sh failed with exit code 1' error and successfully compile your static library.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions