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

177,204

Solution 1

 Target -> Build-Phases -> update examples

Click On Run checkbox if not selected.

Solution 2

I had this issue because i denied keychain access and in order to solve it you need to open keychain, Then click on the lock on top right of the screen to lock it again, after that you can archive and it will work

Solution 3

Deleting "Derived Data" worked for me.

In Xcode go to File > Workspace Settings > Click the arrow next to the Derived Data file path > move the "Derived Data" folder to the trash.

Solution 4

Seems you are running a shell script and it can't find your specific file. Look at Target -> Build-Phases -> RunScript if you are running a script.

You can check if a script is running in your build output (in the navigator panel). If your script does something wrong, the build-phase will stop.

Solution 5

I had same issue got it fixed. Use below steps to resolve issue in Xcode 6.4.

  1. Click on Show project navigator in Navigator window
  2. Now Select project immediately below navigator window
  3. Select Targets
  4. Select Build Phases tab
  5. Open Run Script drop-down option
  6. Select Run script only when installing checkbox

Screenshot for steps

Now, clean your project (cmd+shift+k) and build your project.

Share:
177,204
Ben10
Author by

Ben10

Software Engineer

Updated on July 23, 2020

Comments

  • Ben10
    Ben10 almost 4 years

    I used a cocoa static library in my application. When I compile my library I got the following error:

    Shell Script invocation error:can't open input file:
    /Users/sijuthomas/Library/Developer/Xcode/DerivedData/SCXML2-
        bbttehupryhijphhjdiemcytkvgy/Build/Products/Debug-iphonesimulator/
        libSCXMLParser.a (No such file or directory)
    Command /bin/sh failed with exit code 1
    

    Screenshot for error

    How can I fix this?